Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 126439 Details for
Bug 186385
>=net-misc/dhcpcd-3.0.19 netlink: Network is unreachable
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix netmask calculation for static routes
dhcp.patch (text/plain), 1.03 KB, created by
Roy Marples (RETIRED)
on 2007-07-30 12:22:24 UTC
(
hide
)
Description:
Fix netmask calculation for static routes
Filename:
MIME Type:
Creator:
Roy Marples (RETIRED)
Created:
2007-07-30 12:22:24 UTC
Size:
1.03 KB
patch
obsolete
>Index: dhcp.c >=================================================================== >--- dhcp.c (revision 257) >+++ dhcp.c (working copy) >@@ -492,6 +492,31 @@ > return (sip); > } > >+/* This calculates the netmask that we should use for static routes */ >+static unsigned long route_netmask (unsigned long ip_in) >+{ >+ unsigned long p = ntohl (ip_in); >+ unsigned long t; >+ >+ if (IN_CLASSA (p)) >+ t = ~IN_CLASSA_NET; >+ else { >+ if (IN_CLASSB (p)) >+ t = ~IN_CLASSB_NET; >+ else { >+ if (IN_CLASSC (p)) >+ t = ~IN_CLASSC_NET; >+ else >+ t = 0; >+ } >+ } >+ >+ while (t & p) >+ t >>= 1; >+ >+ return (htonl (~t)); >+} >+ > int parse_dhcpmessage (dhcp_t *dhcp, const dhcpmessage_t *message) > { > const unsigned char *p = message->options; >@@ -705,7 +730,7 @@ > memcpy (&static_routesp->destination.s_addr, p + i, 4); > memcpy (&static_routesp->gateway.s_addr, p + i + 4, 4); > static_routesp->netmask.s_addr = >- get_netmask (static_routesp->destination.s_addr); >+ route_netmask (static_routesp->destination.s_addr); > } > break; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 186385
: 126439