PERFORCE change 166094 for review
Ana Kukec
anchie at FreeBSD.org
Tue Jul 14 18:30:19 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=166094
Change 166094 by anchie at anchie_malimis on 2009/07/14 18:30:10
In RTM_SND message, rtm->rtm_addrs is set to 0, but routing message is
still checked against rti_info[RTAX_DST] == NULL. Skip this check in
case of RTM_SND message.
Affected files ...
.. //depot/projects/soc2009/anchie_send/src/sys/net/rtsock.c#7 edit
Differences ...
==== //depot/projects/soc2009/anchie_send/src/sys/net/rtsock.c#7 (text+ko) ====
@@ -501,11 +501,15 @@
senderr(EINVAL);
}
info.rti_flags = rtm->rtm_flags;
- if (info.rti_info[RTAX_DST] == NULL ||
- info.rti_info[RTAX_DST]->sa_family >= AF_MAX ||
- (info.rti_info[RTAX_GATEWAY] != NULL &&
- info.rti_info[RTAX_GATEWAY]->sa_family >= AF_MAX))
- senderr(EINVAL);
+ if (rtm->rtm_type != RTM_SND) {
+ if (info.rti_info[RTAX_DST] == NULL ||
+ info.rti_info[RTAX_DST]->sa_family >= AF_MAX ||
+ (info.rti_info[RTAX_GATEWAY] != NULL &&
+ info.rti_info[RTAX_GATEWAY]->sa_family >= AF_MAX)) {
+ printf("EINVAL 3");
+ senderr(EINVAL);
+ }
+ }
/*
* Verify that the caller has the appropriate privilege; RTM_GET
* is the only operation the non-superuser is allowed.
@@ -519,6 +523,9 @@
switch (rtm->rtm_type) {
struct rtentry *saved_nrt;
+ case RTM_SND:
+ printf("RTM_SND!");
+
case RTM_ADD:
if (info.rti_info[RTAX_GATEWAY] == NULL)
senderr(EINVAL);
More information about the p4-projects
mailing list