Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:lafenghu
dhcpcd
bnc#565030.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bnc#565030.diff of Package dhcpcd
--- interface.c 2010-01-20 13:20:15.000000000 +0100 +++ interface.c 2010-01-20 13:26:53.000000000 +0100 @@ -956,12 +956,14 @@ nlm = xzalloc (sizeof (*nlm)); nlm->hdr.nlmsg_len = NLMSG_LENGTH (sizeof (struct rtmsg)); + nlm->hdr.nlmsg_type = RTM_NEWROUTE; if (change) nlm->hdr.nlmsg_flags = NLM_F_REPLACE; else if (! del) nlm->hdr.nlmsg_flags = NLM_F_CREATE | NLM_F_EXCL; + else + nlm->hdr.nlmsg_type = RTM_DELROUTE; nlm->hdr.nlmsg_flags |= NLM_F_REQUEST; - nlm->hdr.nlmsg_type = del ? RTM_DELROUTE : RTM_NEWROUTE; nlm->rt.rtm_family = AF_INET; nlm->rt.rtm_table = RT_TABLE_MAIN; @@ -969,19 +971,20 @@ nlm->rt.rtm_scope = RT_SCOPE_NOWHERE; else { nlm->hdr.nlmsg_flags |= NLM_F_CREATE | NLM_F_EXCL; - nlm->rt.rtm_protocol = RTPROT_BOOT; - if (netmask.s_addr == INADDR_BROADCAST || - gateway.s_addr == INADDR_ANY) - nlm->rt.rtm_scope = RT_SCOPE_LINK; - else - nlm->rt.rtm_scope = RT_SCOPE_UNIVERSE; - nlm->rt.rtm_type = RTN_UNICAST; + nlm->rt.rtm_protocol = RTPROT_BOOT; + if (gateway.s_addr == INADDR_ANY || + (gateway.s_addr == destination.s_addr && + netmask.s_addr == INADDR_BROADCAST)) + nlm->rt.rtm_scope = RT_SCOPE_LINK; + else + nlm->rt.rtm_scope = RT_SCOPE_UNIVERSE; + nlm->rt.rtm_type = RTN_UNICAST; } nlm->rt.rtm_dst_len = inet_ntocidr (netmask); add_attr_l (&nlm->hdr, sizeof (*nlm), RTA_DST, &destination.s_addr, sizeof (destination.s_addr)); - if (netmask.s_addr != INADDR_BROADCAST && + if (netmask.s_addr != INADDR_BROADCAST || destination.s_addr != gateway.s_addr) add_attr_l (&nlm->hdr, sizeof (*nlm), RTA_GATEWAY, &gateway.s_addr, sizeof (gateway.s_addr));
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor