Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/ndp/ndp_netlink.c
| Show First 20 Lines • Show All 158 Lines • ▼ Show 20 Lines | if (hdr->nlmsg_type != NL_RTM_NEWROUTE) { | ||||
| /* No route found, unable to guess ifindex */ | /* No route found, unable to guess ifindex */ | ||||
| return (0); | return (0); | ||||
| } | } | ||||
| struct snl_parsed_route r = {}; | struct snl_parsed_route r = {}; | ||||
| if (!snl_parse_nlmsg(ss, hdr, &snl_rtm_route_parser, &r)) | if (!snl_parse_nlmsg(ss, hdr, &snl_rtm_route_parser, &r)) | ||||
| return (0); | return (0); | ||||
| if (r.rta_multipath.num_nhops > 0 || (r.rta_rtflags & RTF_GATEWAY)) | if (r.rta_multipath.count > 0 || (r.rta_rtflags & RTF_GATEWAY)) | ||||
| return (0); | return (0); | ||||
| /* Check if the interface is of supported type */ | /* Check if the interface is of supported type */ | ||||
| if (has_l2(ss, r.rta_oif)) | if (has_l2(ss, r.rta_oif)) | ||||
| return (r.rta_oif); | return (r.rta_oif); | ||||
| /* Check the case when we matched the loopback route for P2P */ | /* Check the case when we matched the loopback route for P2P */ | ||||
| snl_init_writer(ss, &nw); | snl_init_writer(ss, &nw); | ||||
| ▲ Show 20 Lines • Show All 340 Lines • ▼ Show 20 Lines | if (e.error_str != NULL) | ||||
| xo_warnx("set: %s: %s (%s)", host, strerror(e.error), e.error_str); | xo_warnx("set: %s: %s (%s)", host, strerror(e.error), e.error_str); | ||||
| else | else | ||||
| xo_warnx("set %s: %s", host, strerror(e.error)); | xo_warnx("set %s: %s", host, strerror(e.error)); | ||||
| } | } | ||||
| snl_free(&ss); | snl_free(&ss); | ||||
| return (e.error != 0); | return (e.error != 0); | ||||
| } | } | ||||