Re: rtinit, RTF_HOST and netmask
On 04/02/14(Tue) 10:50, Martin Pieuchot wrote: Diff below removes an old comment about bsdi4 and make it clear that netmasks are not needed for routes to host. ok? Anybody? Index: net/route.c === RCS file: /home/ncvs/src/sys/net/route.c,v retrieving revision 1.151 diff -u -p -r1.151 route.c --- net/route.c 23 Jan 2014 10:16:30 - 1.151 +++ net/route.c 4 Feb 2014 09:38:53 - @@ -1119,13 +1119,9 @@ rtinit(struct ifaddr *ifa, int cmd, int info.rti_info[RTAX_LABEL] = rtlabel_id2sa(ifa-ifa_ifp-if_rtlabelid, sa_rl); - /* - * XXX here, it seems that we are assuming that ifa_netmask is NULL - * for RTF_HOST. bsdi4 passes NULL explicitly (via intermediate - * variable) when RTF_HOST is 1. still not sure if i can safely - * change it to meet bsdi4 behavior. - */ - info.rti_info[RTAX_NETMASK] = ifa-ifa_netmask; + if ((flags RTF_HOST) == 0) + info.rti_info[RTAX_NETMASK] = ifa-ifa_netmask; + error = rtrequest1(cmd, info, RTP_CONNECTED, nrt, rtableid); if (cmd == RTM_DELETE) { if (error == 0 (rt = nrt) != NULL) {
Re: rtinit, RTF_HOST and netmask
On Tue, Feb 11, 2014 at 04:00:25PM +0100, Martin Pieuchot wrote: On 04/02/14(Tue) 10:50, Martin Pieuchot wrote: Diff below removes an old comment about bsdi4 and make it clear that netmasks are not needed for routes to host. ok? OK bluhm@ Anybody? Index: net/route.c === RCS file: /home/ncvs/src/sys/net/route.c,v retrieving revision 1.151 diff -u -p -r1.151 route.c --- net/route.c 23 Jan 2014 10:16:30 - 1.151 +++ net/route.c 4 Feb 2014 09:38:53 - @@ -1119,13 +1119,9 @@ rtinit(struct ifaddr *ifa, int cmd, int info.rti_info[RTAX_LABEL] = rtlabel_id2sa(ifa-ifa_ifp-if_rtlabelid, sa_rl); - /* -* XXX here, it seems that we are assuming that ifa_netmask is NULL -* for RTF_HOST. bsdi4 passes NULL explicitly (via intermediate -* variable) when RTF_HOST is 1. still not sure if i can safely -* change it to meet bsdi4 behavior. -*/ - info.rti_info[RTAX_NETMASK] = ifa-ifa_netmask; + if ((flags RTF_HOST) == 0) + info.rti_info[RTAX_NETMASK] = ifa-ifa_netmask; + error = rtrequest1(cmd, info, RTP_CONNECTED, nrt, rtableid); if (cmd == RTM_DELETE) { if (error == 0 (rt = nrt) != NULL) {
Re: rtinit, RTF_HOST and netmask
On Tue, Feb 11, 2014 at 04:00:25PM +0100, Martin Pieuchot wrote: On 04/02/14(Tue) 10:50, Martin Pieuchot wrote: Diff below removes an old comment about bsdi4 and make it clear that netmasks are not needed for routes to host. ok? Anybody? OK claudio@ Index: net/route.c === RCS file: /home/ncvs/src/sys/net/route.c,v retrieving revision 1.151 diff -u -p -r1.151 route.c --- net/route.c 23 Jan 2014 10:16:30 - 1.151 +++ net/route.c 4 Feb 2014 09:38:53 - @@ -1119,13 +1119,9 @@ rtinit(struct ifaddr *ifa, int cmd, int info.rti_info[RTAX_LABEL] = rtlabel_id2sa(ifa-ifa_ifp-if_rtlabelid, sa_rl); - /* -* XXX here, it seems that we are assuming that ifa_netmask is NULL -* for RTF_HOST. bsdi4 passes NULL explicitly (via intermediate -* variable) when RTF_HOST is 1. still not sure if i can safely -* change it to meet bsdi4 behavior. -*/ - info.rti_info[RTAX_NETMASK] = ifa-ifa_netmask; + if ((flags RTF_HOST) == 0) + info.rti_info[RTAX_NETMASK] = ifa-ifa_netmask; + error = rtrequest1(cmd, info, RTP_CONNECTED, nrt, rtableid); if (cmd == RTM_DELETE) { if (error == 0 (rt = nrt) != NULL) { -- :wq Claudio
rtinit, RTF_HOST and netmask
Diff below removes an old comment about bsdi4 and make it clear that netmasks are not needed for routes to host. ok? Index: net/route.c === RCS file: /home/ncvs/src/sys/net/route.c,v retrieving revision 1.151 diff -u -p -r1.151 route.c --- net/route.c 23 Jan 2014 10:16:30 - 1.151 +++ net/route.c 4 Feb 2014 09:38:53 - @@ -1119,13 +1119,9 @@ rtinit(struct ifaddr *ifa, int cmd, int info.rti_info[RTAX_LABEL] = rtlabel_id2sa(ifa-ifa_ifp-if_rtlabelid, sa_rl); - /* -* XXX here, it seems that we are assuming that ifa_netmask is NULL -* for RTF_HOST. bsdi4 passes NULL explicitly (via intermediate -* variable) when RTF_HOST is 1. still not sure if i can safely -* change it to meet bsdi4 behavior. -*/ - info.rti_info[RTAX_NETMASK] = ifa-ifa_netmask; + if ((flags RTF_HOST) == 0) + info.rti_info[RTAX_NETMASK] = ifa-ifa_netmask; + error = rtrequest1(cmd, info, RTP_CONNECTED, nrt, rtableid); if (cmd == RTM_DELETE) { if (error == 0 (rt = nrt) != NULL) {