| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: if_llatbl.c,v 1.18.6.3 2018/03/13 13:27:10 martin Exp $ */ | | 1 | /* $NetBSD: if_llatbl.c,v 1.18.6.4 2018/06/09 14:44:33 martin Exp $ */ |
2 | /* | | 2 | /* |
3 | * Copyright (c) 2004 Luigi Rizzo, Alessandro Cerri. All rights reserved. | | 3 | * Copyright (c) 2004 Luigi Rizzo, Alessandro Cerri. All rights reserved. |
4 | * Copyright (c) 2004-2008 Qing Li. All rights reserved. | | 4 | * Copyright (c) 2004-2008 Qing Li. All rights reserved. |
5 | * Copyright (c) 2008 Kip Macy. All rights reserved. | | 5 | * Copyright (c) 2008 Kip Macy. All rights reserved. |
6 | * Copyright (c) 2015 The NetBSD Foundation, Inc. | | 6 | * Copyright (c) 2015 The NetBSD Foundation, Inc. |
7 | * All rights reserved. | | 7 | * All rights reserved. |
8 | * | | 8 | * |
9 | * Redistribution and use in source and binary forms, with or without | | 9 | * Redistribution and use in source and binary forms, with or without |
10 | * modification, are permitted provided that the following conditions | | 10 | * modification, are permitted provided that the following conditions |
11 | * are met: | | 11 | * are met: |
12 | * 1. Redistributions of source code must retain the above copyright | | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * 2. Redistributions in binary form must reproduce the above copyright | | 14 | * 2. Redistributions in binary form must reproduce the above copyright |
| @@ -102,28 +102,28 @@ lltable_dump_entry(struct lltable *llt, | | | @@ -102,28 +102,28 @@ lltable_dump_entry(struct lltable *llt, |
102 | if (sa->sa_family == AF_INET && lle->la_flags & LLE_PUB) { | | 102 | if (sa->sa_family == AF_INET && lle->la_flags & LLE_PUB) { |
103 | struct sockaddr_inarp *sin; | | 103 | struct sockaddr_inarp *sin; |
104 | sin = (struct sockaddr_inarp *)sa; | | 104 | sin = (struct sockaddr_inarp *)sa; |
105 | sin->sin_other = SIN_PROXY; | | 105 | sin->sin_other = SIN_PROXY; |
106 | } | | 106 | } |
107 | if ((error = rt_msg3(RTM_GET, &info, 0, w, &size))) | | 107 | if ((error = rt_msg3(RTM_GET, &info, 0, w, &size))) |
108 | return error; | | 108 | return error; |
109 | if (w->w_where && w->w_tmem && w->w_needed <= 0) { | | 109 | if (w->w_where && w->w_tmem && w->w_needed <= 0) { |
110 | struct rt_msghdr *rtm = (struct rt_msghdr *)w->w_tmem; | | 110 | struct rt_msghdr *rtm = (struct rt_msghdr *)w->w_tmem; |
111 | | | 111 | |
112 | /* Need to copy by myself */ | | 112 | /* Need to copy by myself */ |
113 | rtm->rtm_index = ifp->if_index; | | 113 | rtm->rtm_index = ifp->if_index; |
114 | rtm->rtm_rmx.rmx_mtu = 0; | | 114 | rtm->rtm_rmx.rmx_mtu = 0; |
115 | rtm->rtm_rmx.rmx_expire = | | 115 | rtm->rtm_rmx.rmx_expire = (lle->la_flags & LLE_STATIC) ? 0 : |
116 | (lle->la_flags & LLE_STATIC) ? 0 : lle->la_expire; | | 116 | time_mono_to_wall(lle->la_expire); |
117 | rtm->rtm_flags = RTF_UP; | | 117 | rtm->rtm_flags = RTF_UP; |
118 | rtm->rtm_flags |= RTF_HOST; /* For ndp */ | | 118 | rtm->rtm_flags |= RTF_HOST; /* For ndp */ |
119 | /* For backward compatibility */ | | 119 | /* For backward compatibility */ |
120 | rtm->rtm_flags |= RTF_LLINFO | RTF_CLONED; | | 120 | rtm->rtm_flags |= RTF_LLINFO | RTF_CLONED; |
121 | rtm->rtm_flags |= (lle->la_flags & LLE_STATIC) ? RTF_STATIC : 0; | | 121 | rtm->rtm_flags |= (lle->la_flags & LLE_STATIC) ? RTF_STATIC : 0; |
122 | if (lle->la_flags & LLE_PUB) | | 122 | if (lle->la_flags & LLE_PUB) |
123 | rtm->rtm_flags |= RTF_ANNOUNCE; | | 123 | rtm->rtm_flags |= RTF_ANNOUNCE; |
124 | rtm->rtm_addrs = info.rti_addrs; | | 124 | rtm->rtm_addrs = info.rti_addrs; |
125 | if ((error = copyout(rtm, w->w_where, size)) != 0) | | 125 | if ((error = copyout(rtm, w->w_where, size)) != 0) |
126 | w->w_where = NULL; | | 126 | w->w_where = NULL; |
127 | else | | 127 | else |
128 | w->w_where = (char *)w->w_where + size; | | 128 | w->w_where = (char *)w->w_where + size; |
129 | } | | 129 | } |