-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ipv4: support sport, dport and ip_proto in RTM_GETROUTE
This is a followup to fib rules sport, dport and ipproto match support. Only supports tcp, udp and icmp for ipproto. Used by fib rule self tests. Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
Roopa Prabhu
authored and
David S. Miller
committed
May 23, 2018
1 parent
273de02
commit 404eb77
Showing
6 changed files
with
140 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <linux/netlink.h> | ||
#include <linux/rtnetlink.h> | ||
#include <linux/types.h> | ||
#include <net/net_namespace.h> | ||
#include <net/netlink.h> | ||
#include <net/ip.h> | ||
|
||
int rtm_getroute_parse_ip_proto(struct nlattr *attr, u8 *ip_proto, | ||
struct netlink_ext_ack *extack) | ||
{ | ||
*ip_proto = nla_get_u8(attr); | ||
|
||
switch (*ip_proto) { | ||
case IPPROTO_TCP: | ||
case IPPROTO_UDP: | ||
case IPPROTO_ICMP: | ||
return 0; | ||
default: | ||
NL_SET_ERR_MSG(extack, "Unsupported ip proto"); | ||
return -EOPNOTSUPP; | ||
} | ||
} | ||
EXPORT_SYMBOL_GPL(rtm_getroute_parse_ip_proto); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters