Page MenuHomeFreeBSD

D36170.diff
No OneTemporary

D36170.diff

Index: sys/nfs/bootp_subr.c
===================================================================
--- sys/nfs/bootp_subr.c
+++ sys/nfs/bootp_subr.c
@@ -977,25 +977,14 @@
static void
bootpc_add_default_route(struct bootpc_ifcontext *ifctx)
{
+ struct rib_cmd_info rc = {};
int error;
- struct sockaddr_in defdst;
- struct sockaddr_in defmask;
- struct rt_addrinfo info;
- struct rib_cmd_info rc;
if (ifctx->gw.sin_addr.s_addr == htonl(INADDR_ANY))
return;
- clear_sinaddr(&defdst);
- clear_sinaddr(&defmask);
-
- bzero((caddr_t)&info, sizeof(info));
- info.rti_flags = RTF_UP | RTF_GATEWAY | RTF_STATIC;
- info.rti_info[RTAX_DST] = (struct sockaddr *)&defdst;
- info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&defmask;
- info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&ifctx->gw;
-
- error = rib_action(RT_DEFAULT_FIB, RTM_ADD, &info, &rc);
+ error = rib_add_default_route(RT_DEFAULT_FIB, AF_INET,
+ ifctx->ifp, (struct sockaddr *)&ifctx->gw, &rc);
if (error != 0) {
printf("%s: RTM_ADD, error=%d\n", __func__, error);
@@ -1006,24 +995,16 @@
bootpc_remove_default_route(struct bootpc_ifcontext *ifctx)
{
int error;
- struct sockaddr_in defdst;
- struct sockaddr_in defmask;
- struct rt_addrinfo info;
+ struct sockaddr_in dst;
struct rib_cmd_info rc;
if (ifctx->gw.sin_addr.s_addr == htonl(INADDR_ANY))
return;
- clear_sinaddr(&defdst);
- clear_sinaddr(&defmask);
-
- bzero((caddr_t)&info, sizeof(info));
- info.rti_flags = RTF_UP | RTF_GATEWAY | RTF_STATIC;
- info.rti_info[RTAX_DST] = (struct sockaddr *)&defdst;
- info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&defmask;
- info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&ifctx->gw;
+ clear_sinaddr(&dst);
- error = rib_action(RT_DEFAULT_FIB, RTM_DELETE, &info, &rc);
+ error = rib_del_route_px(RT_DEFAULT_FIB, (struct sockaddr *)&dst, 0,
+ rib_match_gw, (struct sockaddr *)&ifctx->gw, 0, &rc);
if (error != 0) {
printf("%s: RTM_DELETE, error=%d\n", __func__, error);
}

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 14, 7:03 PM (8 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15393350
Default Alt Text
D36170.diff (1 KB)

Event Timeline