fib_semantics.c (b75ed8b1aa9c3a99702159c3be8b0c1d54972ae5) | fib_semantics.c (f1741730dd18828fe3ea5fa91c22f41cf001c625) |
---|---|
1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * IPv4 Forwarding Information Base: semantics. 7 * 8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> --- 454 unchanged lines hidden (view full) --- 463} 464 465int fib_nh_init(struct net *net, struct fib_nh *nh, 466 struct fib_config *cfg, int nh_weight, 467 struct netlink_ext_ack *extack) 468{ 469 int err = -ENOMEM; 470 | 1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * IPv4 Forwarding Information Base: semantics. 7 * 8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> --- 454 unchanged lines hidden (view full) --- 463} 464 465int fib_nh_init(struct net *net, struct fib_nh *nh, 466 struct fib_config *cfg, int nh_weight, 467 struct netlink_ext_ack *extack) 468{ 469 int err = -ENOMEM; 470 |
471 nh->fib_nh_family = AF_INET; 472 |
|
471 nh->nh_pcpu_rth_output = alloc_percpu(struct rtable __rcu *); 472 if (!nh->nh_pcpu_rth_output) 473 goto err_out; 474 475 if (cfg->fc_encap) { 476 struct lwtunnel_state *lwtstate; 477 478 err = -EINVAL; --- 6 unchanged lines hidden (view full) --- 485 &lwtstate, extack); 486 if (err) 487 goto lwt_failure; 488 489 nh->fib_nh_lws = lwtstate_get(lwtstate); 490 } 491 492 nh->fib_nh_oif = cfg->fc_oif; | 473 nh->nh_pcpu_rth_output = alloc_percpu(struct rtable __rcu *); 474 if (!nh->nh_pcpu_rth_output) 475 goto err_out; 476 477 if (cfg->fc_encap) { 478 struct lwtunnel_state *lwtstate; 479 480 err = -EINVAL; --- 6 unchanged lines hidden (view full) --- 487 &lwtstate, extack); 488 if (err) 489 goto lwt_failure; 490 491 nh->fib_nh_lws = lwtstate_get(lwtstate); 492 } 493 494 nh->fib_nh_oif = cfg->fc_oif; |
493 nh->fib_nh_gw4 = cfg->fc_gw; | 495 if (cfg->fc_gw) { 496 nh->fib_nh_gw4 = cfg->fc_gw; 497 nh->fib_nh_has_gw = 1; 498 } |
494 nh->fib_nh_flags = cfg->fc_flags; 495 496#ifdef CONFIG_IP_ROUTE_CLASSID 497 nh->nh_tclassid = cfg->fc_flow; 498 if (nh->nh_tclassid) 499 net->ipv4.fib_num_tclassid_users++; 500#endif 501#ifdef CONFIG_IP_ROUTE_MULTIPATH --- 1282 unchanged lines hidden --- | 499 nh->fib_nh_flags = cfg->fc_flags; 500 501#ifdef CONFIG_IP_ROUTE_CLASSID 502 nh->nh_tclassid = cfg->fc_flow; 503 if (nh->nh_tclassid) 504 net->ipv4.fib_num_tclassid_users++; 505#endif 506#ifdef CONFIG_IP_ROUTE_MULTIPATH --- 1282 unchanged lines hidden --- |