View | Details | Raw Unified
Collapse All | Expand All

(-) dhcpcd-3.0.8/dhcp.c (-1 / +1 lines)
 Lines 165-172    Link Here 
	  *p++ = DHCP_CSR;
	  *p++ = DHCP_CSR;
	  /* RFC 3442 states classless static routes should be before routers
	  /* RFC 3442 states classless static routes should be before routers
	   * and static routes as classless static routes override them both */
	   * and static routes as classless static routes override them both */
	  *p++ = DHCP_ROUTERS;
	  *p++ = DHCP_STATICROUTE;
	  *p++ = DHCP_STATICROUTE;
	  *p++ = DHCP_ROUTERS;
	  *p++ = DHCP_HOSTNAME;
	  *p++ = DHCP_HOSTNAME;
	  *p++ = DHCP_DNSSEARCH;
	  *p++ = DHCP_DNSSEARCH;
	  *p++ = DHCP_DNSDOMAIN;
	  *p++ = DHCP_DNSDOMAIN;
(-) dhcpcd-3.0.8/interface.c (-6 / +16 lines)
 Lines 318-324    Link Here 
  rtm.hdr.rtm_type = change ? RTM_CHANGE : del ? RTM_DELETE : RTM_ADD;
  rtm.hdr.rtm_type = change ? RTM_CHANGE : del ? RTM_DELETE : RTM_ADD;
  rtm.hdr.rtm_flags = RTF_UP | RTF_GATEWAY | RTF_STATIC;
  rtm.hdr.rtm_flags = RTF_UP | RTF_GATEWAY | RTF_STATIC;
  if (netmask.s_addr == 0xffffffff)
  if (netmask.s_addr == INADDR_BROADCAST) 
    rtm.hdr.rtm_flags |= RTF_HOST;
    rtm.hdr.rtm_flags |= RTF_HOST;
  rtm.hdr.rtm_addrs = RTA_DST | RTA_GATEWAY | RTA_NETMASK;
  rtm.hdr.rtm_addrs = RTA_DST | RTA_GATEWAY | RTA_NETMASK;
 Lines 610-618    Link Here 
  dstd = strdup (inet_ntoa (destination));
  dstd = strdup (inet_ntoa (destination));
  gend = strdup (inet_ntoa (netmask));
  gend = strdup (inet_ntoa (netmask));
  logger (LOG_INFO, "%s route to %s (%s) via %s, metric %d",
  if (gateway.s_addr == destination.s_addr)
	  change ? "changing" : del ? "removing" : "adding",
    logger (LOG_INFO, "%s route to %s (%s) metric %d",
	  dstd, gend, inet_ntoa (gateway), metric);
	    change ? "changing" : del ? "removing" : "adding",
	    dstd, gend, metric);
  else if (destination.s_addr == INADDR_ANY && netmask.s_addr == INADDR_ANY)
    logger (LOG_INFO, "%s default route via %s",
	    change ? "changing" : del ? "removing" : "adding",
	    inet_ntoa (gateway));
  else
    logger (LOG_INFO, "%s route to %s (%s) via %s, metric %d",
	    change ? "changing" : del ? "removing" : "adding",
	    dstd, gend, inet_ntoa (gateway), metric);
  if (dstd)
  if (dstd)
    free (dstd);
    free (dstd);
  if (gend)
  if (gend)
 Lines 636-642    Link Here 
    {
    {
      nlm.hdr.nlmsg_flags |= NLM_F_CREATE | NLM_F_EXCL;
      nlm.hdr.nlmsg_flags |= NLM_F_CREATE | NLM_F_EXCL;
      nlm.rt.rtm_protocol = RTPROT_BOOT;
      nlm.rt.rtm_protocol = RTPROT_BOOT;
      if (gateway.s_addr == 0)
       if (gateway.s_addr == INADDR_ANY ||
	   gateway.s_addr == destination.s_addr)
	nlm.rt.rtm_scope = RT_SCOPE_LINK;
	nlm.rt.rtm_scope = RT_SCOPE_LINK;
      else
      else
	nlm.rt.rtm_scope = RT_SCOPE_UNIVERSE;
	nlm.rt.rtm_scope = RT_SCOPE_UNIVERSE;
 Lines 652-658    Link Here 
  add_attr_l (&nlm.hdr, sizeof (nlm), RTA_DST, &destination.s_addr,
  add_attr_l (&nlm.hdr, sizeof (nlm), RTA_DST, &destination.s_addr,
	      sizeof (destination.s_addr));
	      sizeof (destination.s_addr));
  if (gateway.s_addr != 0)
  if (gateway.s_addr != 0 && gateway.s_addr != destination.s_addr)
    add_attr_l (&nlm.hdr, sizeof (nlm), RTA_GATEWAY, &gateway.s_addr,
    add_attr_l (&nlm.hdr, sizeof (nlm), RTA_GATEWAY, &gateway.s_addr,
		sizeof (gateway.s_addr));
		sizeof (gateway.s_addr));