|
40 | 40 |
|
41 | 41 | #define KNI_MODULE_NAME ("rte_kni") |
42 | 42 |
|
| 43 | +/* Defined in the kernel headers, but not included in net/if.h. */ |
| 44 | +#define IFF_LOWER_UP (1<<16) |
| 45 | + |
43 | 46 | /* |
44 | 47 | * According to init_module(2) and delete_module(2), there |
45 | 48 | * are no declarations for these functions in header files. |
@@ -233,7 +236,7 @@ modify_link(struct mnl_socket *nl, struct rte_kni *kni, |
233 | 236 | ifm->ifi_change = IFF_UP; |
234 | 237 | ifm->ifi_flags = flags; |
235 | 238 |
|
236 | | - mnl_attr_put_str(nlh, IFLA_IFNAME, kni_name); |
| 239 | + mnl_attr_put_strz(nlh, IFLA_IFNAME, kni_name); |
237 | 240 |
|
238 | 241 | /* |
239 | 242 | * The KNI library registers callbacks for MTU changes and |
@@ -1225,10 +1228,10 @@ rd_fill_getlink_reply(const struct cps_config *cps_conf, |
1225 | 1228 | ifim->ifi_family = AF_UNSPEC; |
1226 | 1229 | ifim->ifi_type = ARPHRD_ETHER; |
1227 | 1230 | ifim->ifi_index = kni_index; |
1228 | | - ifim->ifi_flags = 0; |
| 1231 | + ifim->ifi_flags = IFF_UP|IFF_LOWER_UP; |
1229 | 1232 | ifim->ifi_change = 0xFFFFFFFF; |
1230 | 1233 |
|
1231 | | - mnl_attr_put_str(reply, IFLA_IFNAME, kni_name); |
| 1234 | + mnl_attr_put_strz(reply, IFLA_IFNAME, kni_name); |
1232 | 1235 | mnl_attr_put_u32(reply, IFLA_MTU, kni_mtu); |
1233 | 1236 | } |
1234 | 1237 |
|
|
0 commit comments