* Re: [PATCH iproute2 1/3] sr: add header files for SR-IPv6
From: Tom Herbert @ 2017-01-10 17:25 UTC (permalink / raw)
To: David Lebrun; +Cc: Linux Kernel Network Developers
In-Reply-To: <1484066486-22152-2-git-send-email-david.lebrun@uclouvain.be>
Acked-by: Tom Herbert <tom@herbertland.com>
On Tue, Jan 10, 2017 at 8:41 AM, David Lebrun <david.lebrun@uclouvain.be> wrote:
> This patch add the necessary header files to interface with the SR-IPv6 kernel
> implementation.
>
> Signed-off-by: David Lebrun <david.lebrun@uclouvain.be>
> ---
> include/linux/seg6.h | 54 +++++++++++++++++++++++++++++++++++++++++++
> include/linux/seg6_genl.h | 32 +++++++++++++++++++++++++
> include/linux/seg6_hmac.h | 21 +++++++++++++++++
> include/linux/seg6_iptunnel.h | 38 ++++++++++++++++++++++++++++++
> 4 files changed, 145 insertions(+)
> create mode 100644 include/linux/seg6.h
> create mode 100644 include/linux/seg6_genl.h
> create mode 100644 include/linux/seg6_hmac.h
> create mode 100644 include/linux/seg6_iptunnel.h
>
> diff --git a/include/linux/seg6.h b/include/linux/seg6.h
> new file mode 100644
> index 0000000..8f651bf
> --- /dev/null
> +++ b/include/linux/seg6.h
> @@ -0,0 +1,54 @@
> +/*
> + * SR-IPv6 implementation
> + *
> + * Author:
> + * David Lebrun <david.lebrun@uclouvain.be>
> + *
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version
> + * 2 of the License, or (at your option) any later version.
> + */
> +
> +#ifndef _SEG6_H
> +#define _SEG6_H
> +
> +/*
> + * SRH
> + */
> +struct ipv6_sr_hdr {
> + __u8 nexthdr;
> + __u8 hdrlen;
> + __u8 type;
> + __u8 segments_left;
> + __u8 first_segment;
> + __u8 flag_1;
> + __u8 flag_2;
> + __u8 reserved;
> +
> + struct in6_addr segments[0];
> +};
> +
> +#define SR6_FLAG1_CLEANUP (1 << 7)
> +#define SR6_FLAG1_PROTECTED (1 << 6)
> +#define SR6_FLAG1_OAM (1 << 5)
> +#define SR6_FLAG1_ALERT (1 << 4)
> +#define SR6_FLAG1_HMAC (1 << 3)
> +
> +#define SR6_TLV_INGRESS 1
> +#define SR6_TLV_EGRESS 2
> +#define SR6_TLV_OPAQUE 3
> +#define SR6_TLV_PADDING 4
> +#define SR6_TLV_HMAC 5
> +
> +#define sr_has_cleanup(srh) ((srh)->flag_1 & SR6_FLAG1_CLEANUP)
> +#define sr_has_hmac(srh) ((srh)->flag_1 & SR6_FLAG1_HMAC)
> +
> +struct sr6_tlv {
> + __u8 type;
> + __u8 len;
> + __u8 data[0];
> +};
> +
> +#endif
> diff --git a/include/linux/seg6_genl.h b/include/linux/seg6_genl.h
> new file mode 100644
> index 0000000..36fcbc8
> --- /dev/null
> +++ b/include/linux/seg6_genl.h
> @@ -0,0 +1,32 @@
> +#ifndef _SEG6_GENL_H
> +#define _SEG6_GENL_H
> +
> +#define SEG6_GENL_NAME "SEG6"
> +#define SEG6_GENL_VERSION 0x1
> +
> +enum {
> + SEG6_ATTR_UNSPEC,
> + SEG6_ATTR_DST,
> + SEG6_ATTR_DSTLEN,
> + SEG6_ATTR_HMACKEYID,
> + SEG6_ATTR_SECRET,
> + SEG6_ATTR_SECRETLEN,
> + SEG6_ATTR_ALGID,
> + SEG6_ATTR_HMACINFO,
> + __SEG6_ATTR_MAX,
> +};
> +
> +#define SEG6_ATTR_MAX (__SEG6_ATTR_MAX - 1)
> +
> +enum {
> + SEG6_CMD_UNSPEC,
> + SEG6_CMD_SETHMAC,
> + SEG6_CMD_DUMPHMAC,
> + SEG6_CMD_SET_TUNSRC,
> + SEG6_CMD_GET_TUNSRC,
> + __SEG6_CMD_MAX,
> +};
> +
> +#define SEG6_CMD_MAX (__SEG6_CMD_MAX - 1)
> +
> +#endif
> diff --git a/include/linux/seg6_hmac.h b/include/linux/seg6_hmac.h
> new file mode 100644
> index 0000000..71803d2
> --- /dev/null
> +++ b/include/linux/seg6_hmac.h
> @@ -0,0 +1,21 @@
> +#ifndef _SEG6_HMAC_H
> +#define _SEG6_HMAC_H
> +
> +#include <linux/seg6.h>
> +
> +#define SEG6_HMAC_SECRET_LEN 64
> +#define SEG6_HMAC_FIELD_LEN 32
> +
> +struct sr6_tlv_hmac {
> + struct sr6_tlv tlvhdr;
> + __u16 reserved;
> + __be32 hmackeyid;
> + __u8 hmac[SEG6_HMAC_FIELD_LEN];
> +};
> +
> +enum {
> + SEG6_HMAC_ALGO_SHA1 = 1,
> + SEG6_HMAC_ALGO_SHA256 = 2,
> +};
> +
> +#endif
> diff --git a/include/linux/seg6_iptunnel.h b/include/linux/seg6_iptunnel.h
> new file mode 100644
> index 0000000..0d72a58
> --- /dev/null
> +++ b/include/linux/seg6_iptunnel.h
> @@ -0,0 +1,38 @@
> +/*
> + * SR-IPv6 implementation
> + *
> + * Author:
> + * David Lebrun <david.lebrun@uclouvain.be>
> + *
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version
> + * 2 of the License, or (at your option) any later version.
> + */
> +
> +#ifndef _SEG6_IPTUNNEL_H
> +#define _SEG6_IPTUNNEL_H
> +
> +#include <linux/seg6.h>
> +
> +enum {
> + SEG6_IPTUNNEL_UNSPEC,
> + SEG6_IPTUNNEL_SRH,
> + __SEG6_IPTUNNEL_MAX,
> +};
> +#define SEG6_IPTUNNEL_MAX (__SEG6_IPTUNNEL_MAX - 1)
> +
> +struct seg6_iptunnel_encap {
> + int mode;
> + struct ipv6_sr_hdr srh[0];
> +};
> +
> +#define SEG6_IPTUN_ENCAP_SIZE(x) ((sizeof(*x)) + (((x)->srh->hdrlen + 1) << 3))
> +
> +enum {
> + SEG6_IPTUN_MODE_INLINE,
> + SEG6_IPTUN_MODE_ENCAP,
> +};
> +
> +#endif
> --
> 2.7.3
>
^ permalink raw reply
* Re: [PATCH iproute2 2/3] ip: add ip sr command to control SR-IPv6 internal structures
From: Tom Herbert @ 2017-01-10 17:25 UTC (permalink / raw)
To: David Lebrun; +Cc: Linux Kernel Network Developers
In-Reply-To: <1484066486-22152-3-git-send-email-david.lebrun@uclouvain.be>
On Tue, Jan 10, 2017 at 8:41 AM, David Lebrun <david.lebrun@uclouvain.be> wrote:
> This patch add commands to support the tunnel source properties
> ("ip sr tunsrc") and the HMAC key -> secret, algorithm binding
> ("ip sr hmac").
>
> Signed-off-by: David Lebrun <david.lebrun@uclouvain.be>
> ---
> ip/Makefile | 2 +-
> ip/ip.c | 3 +-
> ip/ip_common.h | 1 +
> ip/ipseg6.c | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 242 insertions(+), 2 deletions(-)
> create mode 100644 ip/ipseg6.c
>
> diff --git a/ip/Makefile b/ip/Makefile
> index 1928489..678a795 100644
> --- a/ip/Makefile
> +++ b/ip/Makefile
> @@ -8,7 +8,7 @@ IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
> link_iptnl.o link_gre6.o iplink_bond.o iplink_bond_slave.o iplink_hsr.o \
> iplink_bridge.o iplink_bridge_slave.o ipfou.o iplink_ipvlan.o \
> iplink_geneve.o iplink_vrf.o iproute_lwtunnel.o ipmacsec.o ipila.o \
> - ipvrf.o
> + ipvrf.o ipseg6.o
>
> RTMONOBJ=rtmon.o
>
> diff --git a/ip/ip.c b/ip/ip.c
> index 07050b0..7c14a8e 100644
> --- a/ip/ip.c
> +++ b/ip/ip.c
> @@ -52,7 +52,7 @@ static void usage(void)
> "where OBJECT := { link | address | addrlabel | route | rule | neigh | ntable |\n"
> " tunnel | tuntap | maddress | mroute | mrule | monitor | xfrm |\n"
> " netns | l2tp | fou | macsec | tcp_metrics | token | netconf | ila |\n"
> -" vrf }\n"
> +" vrf | sr }\n"
> " OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n"
> " -h[uman-readable] | -iec |\n"
> " -f[amily] { inet | inet6 | ipx | dnet | mpls | bridge | link } |\n"
> @@ -101,6 +101,7 @@ static const struct cmd {
> { "netns", do_netns },
> { "netconf", do_ipnetconf },
> { "vrf", do_ipvrf},
> + { "sr", do_seg6 },
> { "help", do_help },
> { 0 }
> };
> diff --git a/ip/ip_common.h b/ip/ip_common.h
> index ab6a834..13108c6 100644
> --- a/ip/ip_common.h
> +++ b/ip/ip_common.h
> @@ -59,6 +59,7 @@ int do_ipnetconf(int argc, char **argv);
> int do_iptoken(int argc, char **argv);
> int do_ipvrf(int argc, char **argv);
> void vrf_reset(void);
> +int do_seg6(int argc, char **argv);
>
> int iplink_get(unsigned int flags, char *name, __u32 filt_mask);
>
> diff --git a/ip/ipseg6.c b/ip/ipseg6.c
> new file mode 100644
> index 0000000..0d4130e
> --- /dev/null
> +++ b/ip/ipseg6.c
> @@ -0,0 +1,238 @@
> +/*
> + * seg6.c "ip sr/seg6"
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * version 2 as published by the Free Software Foundation;
> + *
> + * Author: David Lebrun <david.lebrun@uclouvain.be>
> + */
> +
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <string.h>
> +#include <unistd.h>
> +#include <errno.h>
> +#include <sys/types.h>
> +#include <sys/socket.h>
> +#include <arpa/inet.h>
> +#include <sys/ioctl.h>
> +#include <linux/if.h>
> +
> +#include <linux/genetlink.h>
> +#include <linux/seg6_genl.h>
> +#include <linux/seg6_hmac.h>
> +
> +#include "utils.h"
> +#include "ip_common.h"
> +#include "libgenl.h"
> +
> +#define HMAC_KEY_PROMPT "Enter secret for HMAC key ID (blank to delete): "
> +
> +static void usage(void)
> +{
> + fprintf(stderr, "Usage: ip sr { COMMAND | help }\n");
> + fprintf(stderr, " ip sr hmac show\n");
> + fprintf(stderr, " ip sr hmac set KEYID ALGO\n");
> + fprintf(stderr, " ip sr tunsrc show\n");
> + fprintf(stderr, " ip sr tunsrc set ADDRESS\n");
> + fprintf(stderr, "where ALGO := { sha1 | sha256 }\n");
> + exit(-1);
> +}
> +
> +static struct rtnl_handle grth = { .fd = -1 };
> +static int genl_family = -1;
> +
> +#define SEG6_REQUEST(_req, _bufsiz, _cmd, _flags) \
> + GENL_REQUEST(_req, _bufsiz, genl_family, 0, \
> + SEG6_GENL_VERSION, _cmd, _flags)
> +
> +static struct {
> + int cmd;
> + struct in6_addr addr;
> + __u32 keyid;
> + char *pass;
> + __u8 alg_id;
> +} opts;
> +
> +static int process_msg(const struct sockaddr_nl *who, struct nlmsghdr *n,
> + void *arg)
> +{
> + struct rtattr *attrs[SEG6_ATTR_MAX + 1];
> + struct genlmsghdr *ghdr;
> + FILE *fp = (FILE *)arg;
> + int len = n->nlmsg_len;
> +
> + if (n->nlmsg_type != genl_family)
> + return -1;
> +
> + len -= NLMSG_LENGTH(GENL_HDRLEN);
> + if (len < 0)
> + return -1;
> +
> + ghdr = NLMSG_DATA(n);
> +
> + parse_rtattr(attrs, SEG6_ATTR_MAX, (void *)ghdr + GENL_HDRLEN, len);
> +
> + switch (ghdr->cmd) {
> + case SEG6_CMD_DUMPHMAC:
> + {
> + char secret[64];
> + char *algstr;
> + __u8 slen = rta_getattr_u8(attrs[SEG6_ATTR_SECRETLEN]);
> + __u8 alg_id = rta_getattr_u8(attrs[SEG6_ATTR_ALGID]);
> +
> + memset(secret, 0, 64);
> +
> + if (slen > 63) {
> + fprintf(stderr, "HMAC secret length %d > 63, "
> + "truncated\n", slen);
> + slen = 63;
> + }
> + memcpy(secret, RTA_DATA(attrs[SEG6_ATTR_SECRET]), slen);
> +
> + switch (alg_id) {
> + case SEG6_HMAC_ALGO_SHA1:
> + algstr = "sha1";
> + break;
> + case SEG6_HMAC_ALGO_SHA256:
> + algstr = "sha256";
> + break;
> + default:
> + algstr = "<unknown>";
> + }
> +
> + fprintf(fp, "hmac %u ",
> + rta_getattr_u32(attrs[SEG6_ATTR_HMACKEYID]));
> + fprintf(fp, "algo %s ", algstr);
> + fprintf(fp, "secret \"%s\" ", secret);
> +
> + fprintf(fp, "\n");
> + break;
> + }
> + case SEG6_CMD_GET_TUNSRC:
> + {
> + fprintf(fp, "tunsrc addr %s\n",
> + rt_addr_n2a(AF_INET6, 16,
> + RTA_DATA(attrs[SEG6_ATTR_DST])));
> + break;
> + }
> + }
> +
> + return 0;
> +}
> +
> +static int seg6_do_cmd(void)
> +{
> + SEG6_REQUEST(req, 1024, opts.cmd, NLM_F_REQUEST);
> + int repl = 0, dump = 0;
> +
> + if (genl_family < 0) {
> + if (rtnl_open_byproto(&grth, 0, NETLINK_GENERIC) < 0) {
> + fprintf(stderr, "Cannot open generic netlink socket\n");
> + exit(1);
> + }
> + genl_family = genl_resolve_family(&grth, SEG6_GENL_NAME);
> + if (genl_family < 0)
> + exit(1);
> + req.n.nlmsg_type = genl_family;
> + }
> +
> + switch (opts.cmd) {
> + case SEG6_CMD_SETHMAC:
> + {
> + addattr32(&req.n, sizeof(req), SEG6_ATTR_HMACKEYID, opts.keyid);
> + addattr8(&req.n, sizeof(req), SEG6_ATTR_SECRETLEN,
> + strlen(opts.pass));
> + addattr8(&req.n, sizeof(req), SEG6_ATTR_ALGID, opts.alg_id);
> + if (strlen(opts.pass))
> + addattr_l(&req.n, sizeof(req), SEG6_ATTR_SECRET,
> + opts.pass, strlen(opts.pass));
> + break;
> + }
> + case SEG6_CMD_SET_TUNSRC:
> + addattr_l(&req.n, sizeof(req), SEG6_ATTR_DST, &opts.addr,
> + sizeof(struct in6_addr));
> + break;
> + case SEG6_CMD_DUMPHMAC:
> + dump = 1;
> + break;
> + case SEG6_CMD_GET_TUNSRC:
> + repl = 1;
> + break;
> + }
> +
> + if (!repl && !dump) {
> + if (rtnl_talk(&grth, &req.n, NULL, 0) < 0)
> + return -1;
> + } else if (repl) {
> + if (rtnl_talk(&grth, &req.n, &req.n, sizeof(req)) < 0)
> + return -2;
> + if (process_msg(NULL, &req.n, stdout) < 0) {
> + fprintf(stderr, "Error parsing reply\n");
> + exit(1);
> + }
> + } else {
> + req.n.nlmsg_flags |= NLM_F_DUMP;
> + req.n.nlmsg_seq = grth.dump = ++grth.seq;
> + if (rtnl_send(&grth, &req, req.n.nlmsg_len) < 0) {
> + perror("Failed to send dump request");
> + exit(1);
> + }
> +
> + if (rtnl_dump_filter(&grth, process_msg, stdout) < 0) {
> + fprintf(stderr, "Dump terminated\n");
> + exit(1);
> + }
> + }
> +
> + return 0;
> +}
> +
> +int do_seg6(int argc, char **argv)
> +{
> + if (argc < 1 || matches(*argv, "help") == 0)
> + usage();
> +
> + memset(&opts, 0, sizeof(opts));
> +
> + if (matches(*argv, "hmac") == 0) {
> + NEXT_ARG();
> + if (matches(*argv, "show") == 0) {
> + opts.cmd = SEG6_CMD_DUMPHMAC;
> + } else if (matches(*argv, "set") == 0) {
> + NEXT_ARG();
> + if (get_u32(&opts.keyid, *argv, 0) || opts.keyid == 0)
> + invarg("hmac KEYID value is invalid", *argv);
> + NEXT_ARG();
> + if (strcmp(*argv, "sha1") == 0) {
> + opts.alg_id = SEG6_HMAC_ALGO_SHA1;
> + } else if (strcmp(*argv, "sha256") == 0) {
> + opts.alg_id = SEG6_HMAC_ALGO_SHA256;
> + } else {
> + invarg("hmac ALGO value is invalid", *argv);
> + }
> + opts.cmd = SEG6_CMD_SETHMAC;
> + opts.pass = getpass(HMAC_KEY_PROMPT);
> + } else {
> + invarg("unknown", *argv);
> + }
> + } else if (matches(*argv, "tunsrc") == 0) {
> + NEXT_ARG();
> + if (matches(*argv, "show") == 0) {
> + opts.cmd = SEG6_CMD_GET_TUNSRC;
> + } else if (matches(*argv, "set") == 0) {
> + NEXT_ARG();
> + opts.cmd = SEG6_CMD_SET_TUNSRC;
> + if (!inet_get_addr(*argv, NULL, &opts.addr))
> + invarg("tunsrc ADDRESS value is invalid",
> + *argv);
> + } else {
> + invarg("unknown", *argv);
> + }
> + } else {
> + invarg("unknown", *argv);
> + }
> +
> + return seg6_do_cmd();
> +}
> --
> 2.7.3
>
Acked-by: Tom Herbert <tom@herbertland.com>
^ permalink raw reply
* Re: [PATCH iproute2 3/3] iproute: add support for SR-IPv6 lwtunnel encapsulation
From: Tom Herbert @ 2017-01-10 17:26 UTC (permalink / raw)
To: David Lebrun; +Cc: Linux Kernel Network Developers
In-Reply-To: <1484066486-22152-4-git-send-email-david.lebrun@uclouvain.be>
On Tue, Jan 10, 2017 at 8:41 AM, David Lebrun <david.lebrun@uclouvain.be> wrote:
> This patch adds support for SEG6 encapsulation type
> ("ip route add ... encap seg6 ...").
>
> Signed-off-by: David Lebrun <david.lebrun@uclouvain.be>
> ---
> ip/iproute.c | 6 +-
> ip/iproute_lwtunnel.c | 160 ++++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 164 insertions(+), 2 deletions(-)
>
> diff --git a/ip/iproute.c b/ip/iproute.c
> index e433de8..a102e33 100644
> --- a/ip/iproute.c
> +++ b/ip/iproute.c
> @@ -98,8 +98,10 @@ static void usage(void)
> fprintf(stderr, "TIME := NUMBER[s|ms]\n");
> fprintf(stderr, "BOOL := [1|0]\n");
> fprintf(stderr, "FEATURES := ecn\n");
> - fprintf(stderr, "ENCAPTYPE := [ mpls | ip | ip6 ]\n");
> - fprintf(stderr, "ENCAPHDR := [ MPLSLABEL ]\n");
> + fprintf(stderr, "ENCAPTYPE := [ mpls | ip | ip6 | seg6 ]\n");
> + fprintf(stderr, "ENCAPHDR := [ MPLSLABEL | SEG6HDR ]\n");
> + fprintf(stderr, "SEG6HDR := [ mode SEGMODE ] segs ADDR1,ADDRi,ADDRn [hmac HMACKEYID] [cleanup]\n");
> + fprintf(stderr, "SEGMODE := [ encap | inline ]\n");
> exit(-1);
> }
>
> diff --git a/ip/iproute_lwtunnel.c b/ip/iproute_lwtunnel.c
> index 1a92cec..3ee6dcc 100644
> --- a/ip/iproute_lwtunnel.c
> +++ b/ip/iproute_lwtunnel.c
> @@ -26,6 +26,10 @@
> #include "iproute_lwtunnel.h"
> #include "bpf_util.h"
>
> +#include <linux/seg6.h>
> +#include <linux/seg6_iptunnel.h>
> +#include <linux/seg6_hmac.h>
> +
> static const char *format_encap_type(int type)
> {
> switch (type) {
> @@ -39,6 +43,8 @@ static const char *format_encap_type(int type)
> return "ila";
> case LWTUNNEL_ENCAP_BPF:
> return "bpf";
> + case LWTUNNEL_ENCAP_SEG6:
> + return "seg6";
> default:
> return "unknown";
> }
> @@ -69,12 +75,51 @@ static int read_encap_type(const char *name)
> return LWTUNNEL_ENCAP_ILA;
> else if (strcmp(name, "bpf") == 0)
> return LWTUNNEL_ENCAP_BPF;
> + else if (strcmp(name, "seg6") == 0)
> + return LWTUNNEL_ENCAP_SEG6;
> else if (strcmp(name, "help") == 0)
> encap_type_usage();
>
> return LWTUNNEL_ENCAP_NONE;
> }
>
> +static void print_encap_seg6(FILE *fp, struct rtattr *encap)
> +{
> + struct rtattr *tb[SEG6_IPTUNNEL_MAX+1];
> + struct seg6_iptunnel_encap *tuninfo;
> + struct ipv6_sr_hdr *srh;
> + int i;
> +
> + parse_rtattr_nested(tb, SEG6_IPTUNNEL_MAX, encap);
> +
> + if (!tb[SEG6_IPTUNNEL_SRH])
> + return;
> +
> + tuninfo = RTA_DATA(tb[SEG6_IPTUNNEL_SRH]);
> + fprintf(fp, "mode %s ",
> + (tuninfo->mode == SEG6_IPTUN_MODE_ENCAP) ? "encap" : "inline");
> +
> + srh = tuninfo->srh;
> +
> + fprintf(fp, "segs %d [ ", srh->first_segment + 1);
> +
> + for (i = srh->first_segment; i >= 0; i--)
> + fprintf(fp, "%s ",
> + rt_addr_n2a(AF_INET6, 16, &srh->segments[i]));
> +
> + fprintf(fp, "] ");
> +
> + if (sr_has_cleanup(srh))
> +
> + if (sr_has_hmac(srh)) {
> + unsigned int offset = ((srh->hdrlen + 1) << 3) - 40;
> + struct sr6_tlv_hmac *tlv;
> +
> + tlv = (struct sr6_tlv_hmac *)((char *)srh + offset);
> + fprintf(fp, "hmac 0x%X ", ntohl(tlv->hmackeyid));
> + }
> +}
> +
> static void print_encap_mpls(FILE *fp, struct rtattr *encap)
> {
> struct rtattr *tb[MPLS_IPTUNNEL_MAX+1];
> @@ -238,9 +283,121 @@ void lwt_print_encap(FILE *fp, struct rtattr *encap_type,
> case LWTUNNEL_ENCAP_BPF:
> print_encap_bpf(fp, encap);
> break;
> + case LWTUNNEL_ENCAP_SEG6:
> + print_encap_seg6(fp, encap);
> + break;
> }
> }
>
> +static int parse_encap_seg6(struct rtattr *rta, size_t len, int *argcp,
> + char ***argvp)
> +{
> + int mode_ok = 0, segs_ok = 0, cleanup_ok = 0, hmac_ok = 0;
> + struct seg6_iptunnel_encap *tuninfo;
> + struct ipv6_sr_hdr *srh;
> + char **argv = *argvp;
> + char segbuf[1024];
> + int argc = *argcp;
> + __u8 cleanup = 0;
> + int encap = -1;
> + __u32 hmac = 0;
> + int nsegs = 0;
> + int srhlen;
> + char *s;
> + int i;
> +
> + while (argc > 0) {
> + if (strcmp(*argv, "mode") == 0) {
> + NEXT_ARG();
> + if (mode_ok++)
> + duparg2("mode", *argv);
> + if (strcmp(*argv, "encap") == 0)
> + encap = 1;
> + else if (strcmp(*argv, "inline") == 0)
> + encap = 0;
> + else
> + invarg("\"mode\" value is invalid\n", *argv);
> + } else if (strcmp(*argv, "segs") == 0) {
> + NEXT_ARG();
> + if (segs_ok++)
> + duparg2("segs", *argv);
> + if (encap == -1)
> + invarg("\"segs\" provided before \"mode\"\n",
> + *argv);
> +
> + strncpy(segbuf, *argv, 1024);
> + segbuf[1023] = 0;
> + } else if (strcmp(*argv, "cleanup") == 0) {
> + if (cleanup_ok++)
> + duparg2("cleanup", *argv);
> + cleanup = 1;
> + } else if (strcmp(*argv, "hmac") == 0) {
> + NEXT_ARG();
> + if (hmac_ok++)
> + duparg2("hmac", *argv);
> + get_u32(&hmac, *argv, 0);
> + } else {
> + break;
> + }
> + argc--; argv++;
> + }
> +
> + s = segbuf;
> + for (i = 0; *s; *s++ == ',' ? i++ : *s);
> + nsegs = i + 1;
> +
> + if (!encap)
> + nsegs++;
> +
> + srhlen = 8 + 16*nsegs;
> +
> + if (hmac)
> + srhlen += 40;
> +
> + tuninfo = malloc(sizeof(*tuninfo) + srhlen);
> + memset(tuninfo, 0, sizeof(*tuninfo) + srhlen);
> +
> + if (encap)
> + tuninfo->mode = SEG6_IPTUN_MODE_ENCAP;
> + else
> + tuninfo->mode = SEG6_IPTUN_MODE_INLINE;
> +
> + srh = tuninfo->srh;
> + srh->hdrlen = (srhlen >> 3) - 1;
> + srh->type = 4;
> + srh->segments_left = nsegs - 1;
> + srh->first_segment = nsegs - 1;
> +
> + if (cleanup)
> + srh->flag_1 |= SR6_FLAG1_CLEANUP;
> + if (hmac)
> + srh->flag_1 |= SR6_FLAG1_HMAC;
> +
> + i = srh->first_segment;
> + for (s = strtok(segbuf, ","); s; s = strtok(NULL, ",")) {
> + inet_get_addr(s, NULL, &srh->segments[i]);
> + i--;
> + }
> +
> + if (hmac) {
> + struct sr6_tlv_hmac *tlv;
> +
> + tlv = (struct sr6_tlv_hmac *)((char *)srh + srhlen - 40);
> + tlv->tlvhdr.type = SR6_TLV_HMAC;
> + tlv->tlvhdr.len = 38;
> + tlv->hmackeyid = htonl(hmac);
> + }
> +
> + rta_addattr_l(rta, len, SEG6_IPTUNNEL_SRH, tuninfo,
> + sizeof(*tuninfo) + srhlen);
> + free(tuninfo);
> +
> + *argcp = argc + 1;
> + *argvp = argv - 1;
> +
> + return 0;
> +}
> +
> static int parse_encap_mpls(struct rtattr *rta, size_t len,
> int *argcp, char ***argvp)
> {
> @@ -573,6 +730,9 @@ int lwt_parse_encap(struct rtattr *rta, size_t len, int *argcp, char ***argvp)
> if (parse_encap_bpf(rta, len, &argc, &argv) < 0)
> exit(-1);
> break;
> + case LWTUNNEL_ENCAP_SEG6:
> + parse_encap_seg6(rta, len, &argc, &argv);
> + break;
> default:
> fprintf(stderr, "Error: unsupported encap type\n");
> break;
> --
> 2.7.3
>
Acked-by: Tom Herbert <tom@herbertland.com>
Is there a place do document all the SR functionality?
^ permalink raw reply
* [PATCH] vxlan: Set flow*_dport when doing route lookups
From: Martynas Pumputis @ 2017-01-10 17:29 UTC (permalink / raw)
To: davem; +Cc: netdev, Martynas Pumputis
Otherwise, no xfrm policy with dport being set can be matched.
Signed-off-by: Martynas Pumputis <martynas@weave.works>
---
drivers/net/vxlan.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index bb70dd5..fcfe786 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -1798,7 +1798,7 @@ static int vxlan_build_skb(struct sk_buff *skb, struct dst_entry *dst,
static struct rtable *vxlan_get_route(struct vxlan_dev *vxlan, struct net_device *dev,
struct vxlan_sock *sock4,
struct sk_buff *skb, int oif, u8 tos,
- __be32 daddr, __be32 *saddr,
+ __be32 daddr, __be32 *saddr, __be16 dport,
struct dst_cache *dst_cache,
const struct ip_tunnel_info *info)
{
@@ -1824,6 +1824,7 @@ static struct rtable *vxlan_get_route(struct vxlan_dev *vxlan, struct net_device
fl4.flowi4_proto = IPPROTO_UDP;
fl4.daddr = daddr;
fl4.saddr = *saddr;
+ fl4.fl4_dport = dport;
rt = ip_route_output_key(vxlan->net, &fl4);
if (likely(!IS_ERR(rt))) {
@@ -1851,6 +1852,7 @@ static struct dst_entry *vxlan6_get_route(struct vxlan_dev *vxlan,
__be32 label,
const struct in6_addr *daddr,
struct in6_addr *saddr,
+ __be16 dport,
struct dst_cache *dst_cache,
const struct ip_tunnel_info *info)
{
@@ -1877,6 +1879,7 @@ static struct dst_entry *vxlan6_get_route(struct vxlan_dev *vxlan,
fl6.flowlabel = ip6_make_flowinfo(RT_TOS(tos), label);
fl6.flowi6_mark = skb->mark;
fl6.flowi6_proto = IPPROTO_UDP;
+ fl6.fl6_dport = dport;
err = ipv6_stub->ipv6_dst_lookup(vxlan->net,
sock6->sock->sk,
@@ -2068,6 +2071,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
rdst ? rdst->remote_ifindex : 0, tos,
dst->sin.sin_addr.s_addr,
&src->sin.sin_addr.s_addr,
+ dst_port,
dst_cache, info);
if (IS_ERR(rt)) {
err = PTR_ERR(rt);
@@ -2104,6 +2108,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
rdst ? rdst->remote_ifindex : 0, tos,
label, &dst->sin6.sin6_addr,
&src->sin6.sin6_addr,
+ dst_port,
dst_cache, info);
if (IS_ERR(ndst)) {
err = PTR_ERR(ndst);
@@ -2430,7 +2435,7 @@ static int vxlan_fill_metadata_dst(struct net_device *dev, struct sk_buff *skb)
rt = vxlan_get_route(vxlan, dev, sock4, skb, 0, info->key.tos,
info->key.u.ipv4.dst,
- &info->key.u.ipv4.src, NULL, info);
+ &info->key.u.ipv4.src, dport, NULL, info);
if (IS_ERR(rt))
return PTR_ERR(rt);
ip_rt_put(rt);
@@ -2441,7 +2446,7 @@ static int vxlan_fill_metadata_dst(struct net_device *dev, struct sk_buff *skb)
ndst = vxlan6_get_route(vxlan, dev, sock6, skb, 0, info->key.tos,
info->key.label, &info->key.u.ipv6.dst,
- &info->key.u.ipv6.src, NULL, info);
+ &info->key.u.ipv6.src, dport, NULL, info);
if (IS_ERR(ndst))
return PTR_ERR(ndst);
dst_release(ndst);
--
2.10.2
^ permalink raw reply related
* Re: Setting link down hangs the kernel
From: Mason @ 2017-01-10 17:29 UTC (permalink / raw)
To: netdev
Cc: Mans Rullgard, Thibaud Cornic, Thomas Gambier, Florian Fainelli,
Andrew Lunn
In-Reply-To: <b478607d-cb69-0efc-5a8c-9b7a54b88d68@free.fr>
On 10/01/2017 16:28, Mason wrote:
> On 10/01/2017 15:36, Mason wrote:
>
>> I'm using kernel v4.9 on a [new] dev board.
>> I built a small kernel + rootfs with buildroot 2016.11.1
>> eth0 is driven by drivers/net/ethernet/aurora/nb8800.c
>>
>> After booting, I just run udhcpc (busybox version)
>> Then I set the link down, and the kernel hangs.
>
> So far, I've been unable to reproduce this issue on an older
> smp8758 dev board.
And another symptom (which exists only on the new board) :
After the first "link down", udhcpc no longer works.
Also, the OS prints "link down" only when udhcpc requests "link up".
I guess I have lots of "fun" things to investigate tomorrow...
Any pointers to where I should look first?
I think some kind of "deferred worker thread" is spawned when the PHY
state machine changes state? Could there be some kind of race there?
Or is it more likely something is broken in the HW?
Welcome to Buildroot
buildroot login: root
# udhcpc && ip addr
udhcpc: started, v1.25.1
udhcpc: sending discover
udhcpc: sending discover
[ 28.427174] nb8800 26000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
udhcpc: sending discover
udhcpc: sending select for 172.27.64.46
udhcpc: lease of 172.27.64.46 obtained, lease time 604800
deleting routers
adding dns 172.27.0.17
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:16:e8:78:2c:b3 brd ff:ff:ff:ff:ff:ff
inet 172.27.64.46/18 brd 172.27.127.255 scope global eth0
valid_lft forever preferred_lft forever
# ip link set dev eth0 down && sleep 10 && udhcpc -T 1 -A 3
udhcpc: started, v1.25.1
udhcpc: sending discover
[ 55.040450] nb8800 26000.ethernet eth0: Link is Down
udhcpc: sending discover
udhcpc: sending discover
[ 57.067154] nb8800 26000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
^C
Regards.
^ permalink raw reply
* Re: net/atm: warning in alloc_tx/__might_sleep
From: Cong Wang @ 2017-01-10 17:35 UTC (permalink / raw)
To: Andrey Konovalov
Cc: David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, netdev, LKML, Al Viro,
Dmitry Vyukov, Kostya Serebryany, Eric Dumazet, syzkaller
In-Reply-To: <CAAeHK+yZ16SKcmJbv2ARafGgAuX2wwQNE0HGdiFy1WgqPjxLMg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2099 bytes --]
On Mon, Jan 9, 2017 at 9:20 AM, Andrey Konovalov <andreyknvl@google.com> wrote:
> Hi!
>
> I've got the following error report while running the syzkaller fuzzer.
>
> On commit a121103c922847ba5010819a3f250f1f7fc84ab8 (4.10-rc3).
>
> A reproducer is attached.
>
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 4114 at kernel/sched/core.c:7737 __might_sleep+0x149/0x1a0
> do not call blocking ops when !TASK_RUNNING; state=1 set at
> [<ffffffff813fcb22>] prepare_to_wait+0x182/0x530
> Modules linked in:
> CPU: 0 PID: 4114 Comm: a.out Not tainted 4.10.0-rc3+ #59
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
> Call Trace:
> __dump_stack lib/dump_stack.c:15
> dump_stack+0x292/0x398 lib/dump_stack.c:51
> __warn+0x19f/0x1e0 kernel/panic.c:547
> warn_slowpath_fmt+0xc5/0x110 kernel/panic.c:562
> __might_sleep+0x149/0x1a0 kernel/sched/core.c:7732
> slab_pre_alloc_hook mm/slab.h:408
> slab_alloc_node mm/slub.c:2634
> kmem_cache_alloc_node+0x14a/0x280 mm/slub.c:2744
> __alloc_skb+0x10f/0x800 net/core/skbuff.c:219
> alloc_skb ./include/linux/skbuff.h:926
> alloc_tx net/atm/common.c:75
> vcc_sendmsg+0x5e8/0x1010 net/atm/common.c:609
> sock_sendmsg_nosec net/socket.c:635
> sock_sendmsg+0xca/0x110 net/socket.c:645
> ___sys_sendmsg+0x9d2/0xae0 net/socket.c:1985
> __sys_sendmsg+0x138/0x320 net/socket.c:2019
> SYSC_sendmsg net/socket.c:2030
> SyS_sendmsg+0x2d/0x50 net/socket.c:2026
> entry_SYSCALL_64_fastpath+0x1f/0xc2 arch/x86/entry/entry_64.S:203
> RIP: 0033:0x7fcbacfddb79
> RSP: 002b:00007ffed8b5a7b8 EFLAGS: 00000206 ORIG_RAX: 000000000000002e
> RAX: ffffffffffffffda RBX: 00007ffed8b5a950 RCX: 00007fcbacfddb79
> RDX: 000000000000c000 RSI: 0000000020002000 RDI: 0000000000000003
> RBP: 0000000000400af0 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000
> R13: 00007ffed8b5a950 R14: 0000000000000000 R15: 0000000000000000
> ---[ end trace 9edf2da84d8112da ]---
> atm:sigd_send: bad message type 0
The fix should be straight-forward. Mind to try the attached patch?
[-- Attachment #2: atm.diff --]
[-- Type: text/plain, Size: 1418 bytes --]
diff --git a/net/atm/common.c b/net/atm/common.c
index a3ca922..b7d9661 100644
--- a/net/atm/common.c
+++ b/net/atm/common.c
@@ -571,8 +571,8 @@ int vcc_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
int vcc_sendmsg(struct socket *sock, struct msghdr *m, size_t size)
{
+ DEFINE_WAIT_FUNC(wait, woken_wake_function);
struct sock *sk = sock->sk;
- DEFINE_WAIT(wait);
struct atm_vcc *vcc;
struct sk_buff *skb;
int eff, error;
@@ -604,7 +604,7 @@ int vcc_sendmsg(struct socket *sock, struct msghdr *m, size_t size)
}
eff = (size+3) & ~3; /* align to word boundary */
- prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
+ add_wait_queue(sk_sleep(sk), &wait);
error = 0;
while (!(skb = alloc_tx(vcc, eff))) {
if (m->msg_flags & MSG_DONTWAIT) {
@@ -612,6 +612,7 @@ int vcc_sendmsg(struct socket *sock, struct msghdr *m, size_t size)
break;
}
schedule();
+ wait_woken(&wait, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT);
if (signal_pending(current)) {
error = -ERESTARTSYS;
break;
@@ -623,9 +624,8 @@ int vcc_sendmsg(struct socket *sock, struct msghdr *m, size_t size)
send_sig(SIGPIPE, current, 0);
break;
}
- prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
}
- finish_wait(sk_sleep(sk), &wait);
+ remove_wait_queue(sk_sleep(sk), &wait);
if (error)
goto out;
skb->dev = NULL; /* for paths shared with net_device interfaces */
^ permalink raw reply related
* Re: [PATCH] net: add the AF_QIPCRTR entries to family name tables
From: Suman Anna @ 2017-01-10 17:39 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, linux-kernel, Bjorn Andersson
In-Reply-To: <20170110034856.49721-1-s-anna@ti.com>
On 01/09/2017 09:48 PM, Suman Anna wrote:
> Commit bdabad3e363d ("net: Add Qualcomm IPC router") introduced a
> new address family. Update the family name tables accordingly so
> that the lockdep initialization can use the proper names for this
> family.
>
> Cc: Courtney Cavin <courtney.cavin@sonymobile.com>
Courtney's email bounced, so this line can be removed.
regards
Suman
> Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
> Signed-off-by: Suman Anna <s-anna@ti.com>
> ---
> net/core/sock.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/net/core/sock.c b/net/core/sock.c
> index f560e0826009..4eca27dc5c94 100644
> --- a/net/core/sock.c
> +++ b/net/core/sock.c
> @@ -222,7 +222,7 @@ static const char *const af_family_key_strings[AF_MAX+1] = {
> "sk_lock-AF_RXRPC" , "sk_lock-AF_ISDN" , "sk_lock-AF_PHONET" ,
> "sk_lock-AF_IEEE802154", "sk_lock-AF_CAIF" , "sk_lock-AF_ALG" ,
> "sk_lock-AF_NFC" , "sk_lock-AF_VSOCK" , "sk_lock-AF_KCM" ,
> - "sk_lock-AF_MAX"
> + "sk_lock-AF_QIPCRTR", "sk_lock-AF_MAX"
> };
> static const char *const af_family_slock_key_strings[AF_MAX+1] = {
> "slock-AF_UNSPEC", "slock-AF_UNIX" , "slock-AF_INET" ,
> @@ -239,7 +239,7 @@ static const char *const af_family_slock_key_strings[AF_MAX+1] = {
> "slock-AF_RXRPC" , "slock-AF_ISDN" , "slock-AF_PHONET" ,
> "slock-AF_IEEE802154", "slock-AF_CAIF" , "slock-AF_ALG" ,
> "slock-AF_NFC" , "slock-AF_VSOCK" ,"slock-AF_KCM" ,
> - "slock-AF_MAX"
> + "slock-AF_QIPCRTR", "slock-AF_MAX"
> };
> static const char *const af_family_clock_key_strings[AF_MAX+1] = {
> "clock-AF_UNSPEC", "clock-AF_UNIX" , "clock-AF_INET" ,
> @@ -256,7 +256,7 @@ static const char *const af_family_clock_key_strings[AF_MAX+1] = {
> "clock-AF_RXRPC" , "clock-AF_ISDN" , "clock-AF_PHONET" ,
> "clock-AF_IEEE802154", "clock-AF_CAIF" , "clock-AF_ALG" ,
> "clock-AF_NFC" , "clock-AF_VSOCK" , "clock-AF_KCM" ,
> - "clock-AF_MAX"
> + "clock-AF_QIPCRTR", "clock-AF_MAX"
> };
>
> /*
>
^ permalink raw reply
* Re: [PATCH net] mlx4: Return EOPNOTSUPP instead of ENOTSUPP
From: Martin KaFai Lau @ 2017-01-10 17:39 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: netdev, Saeed Mahameed, Tariq Toukan, Kernel Team
In-Reply-To: <2e26d5f0-fed8-a2b9-392a-87da29c38758@cogentembedded.com>
On Tue, Jan 10, 2017 at 03:43:39PM +0300, Sergei Shtylyov wrote:
> Hello!
>
> On 01/10/2017 01:13 AM, Martin KaFai Lau wrote:
>
> >In commit b45f0674b997 ("mlx4: xdp: Allow raising MTU up to one page minus eth and vlan hdrs"),
> >it changed ENOTSUPP to EOPNOTSUPP by mistake. This patch fixes it.
>
> You mean vice versa (looking at your patch)?
Indeed. Will send v2 to correct this.
>
> >Fixes: b45f0674b997 ("mlx4: xdp: Allow raising MTU up to one page minus eth and vlan hdrs")
> >Signed-off-by: Martin KaFai Lau <kafai@fb.com>
> >---
> > drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> >index edbe200ac2fa..4910d9af1933 100644
> >--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> >+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> >@@ -2277,7 +2277,7 @@ static int mlx4_en_change_mtu(struct net_device *dev, int new_mtu)
> >
> > if (priv->tx_ring_num[TX_XDP] &&
> > !mlx4_en_check_xdp_mtu(dev, new_mtu))
> >- return -ENOTSUPP;
> >+ return -EOPNOTSUPP;
> >
> > dev->mtu = new_mtu;
> >
>
> MBR, Sergei
>
^ permalink raw reply
* Re: net/atm: warning in alloc_tx/__might_sleep
From: Eric Dumazet @ 2017-01-10 17:40 UTC (permalink / raw)
To: Cong Wang
Cc: Andrey Konovalov, David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, netdev, LKML, Al Viro,
Dmitry Vyukov, Kostya Serebryany, syzkaller
In-Reply-To: <CAM_iQpWaHX_orHbFjKcjBZL67b6LUAmOfvS1SQP13VPZDo-69w@mail.gmail.com>
On Tue, Jan 10, 2017 at 9:35 AM, Cong Wang <xiyou.wangcong@gmail.com> wrote:
> On Mon, Jan 9, 2017 at 9:20 AM, Andrey Konovalov <andreyknvl@google.com> wrote:
>
> The fix should be straight-forward. Mind to try the attached patch?
You forgot to remove schedule() ?
schedule();
+ wait_woken(&wait, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT);
^ permalink raw reply
* [PATCH net v2] mlx4: Return EOPNOTSUPP instead of ENOTSUPP
From: Martin KaFai Lau @ 2017-01-10 17:41 UTC (permalink / raw)
To: netdev; +Cc: Saeed Mahameed, Tariq Toukan, Kernel Team
In commit b45f0674b997 ("mlx4: xdp: Allow raising MTU up to one page minus eth and vlan hdrs"),
it changed EOPNOTSUPP to ENOTSUPP by mistake. This patch fixes it.
Fixes: b45f0674b997 ("mlx4: xdp: Allow raising MTU up to one page minus eth and vlan hdrs")
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index edbe200ac2fa..4910d9af1933 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -2277,7 +2277,7 @@ static int mlx4_en_change_mtu(struct net_device *dev, int new_mtu)
if (priv->tx_ring_num[TX_XDP] &&
!mlx4_en_check_xdp_mtu(dev, new_mtu))
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
dev->mtu = new_mtu;
--
2.5.1
^ permalink raw reply related
* Re: [PATCH net-next] net: ipv6: put autoconf routes into per-interface tables
From: Lorenzo Colitti @ 2017-01-10 17:47 UTC (permalink / raw)
To: Andrey Jr. Melnikov; +Cc: netdev@vger.kernel.org
In-Reply-To: <un3fkd-lod.ln1@banana.localnet>
On Tue, Jan 10, 2017 at 10:21 PM, Andrey Jr. Melnikov
<temnota.am@gmail.com> wrote:
>
> > >>> I have no firsthand experience of this myself, but if the problems
> > >>> that Andrey reports above in this thread are real, then those would
> > >>> indicate that the code is not well-supported. Being unable to accept
> > >>> DAD is a pretty serious issue. Andrey, what version of the kernel did
> > >>> you see this on?
>
> Good catch. I'm running 4.8 without this patch. Current 4.10-rc works. Sorry
> for noise.
Ack. As I said before, I haven't seen this myself. Shouldn't have made
assertions without firsthand evidence.
That said, I think this patch is useful even though autoconf on VRFs
works the same way. One reason is the example I provided above: it
works even for interfaces that don't exist yet, whereas a VRF has to
be created ahead of time, which means that the interface cannot
immediately come up and receive an RA or its configuration will be
incorrect.
I also think that from a configuration perspective it's not
necessarily useful to have one VRF for every interface, but that sort
of depends on your point of view. Perhaps it's fine on a client system
to have both vrf-wlan0 and wlan0, and vrf-eth0 and eth0. That might be
confusing to users but maybe users don't really care?
More in general I think that using a VRFs is buying into a bigger set
of assumptions/restrictions than this patch does. For example, if I'm
reading ipv6_dev_get_saddr correctly, once you put an interface in a
VRF you can't really use the weak host model any more, because the
stack won't pick a source address from outside the VRF if the route
lookup returned a route in the VRF. Turning on the functionality in
patch is a more minimal change that only affects autoconf.
^ permalink raw reply
* Re: net/atm: warning in alloc_tx/__might_sleep
From: Cong Wang @ 2017-01-10 17:55 UTC (permalink / raw)
To: Eric Dumazet
Cc: Andrey Konovalov, David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, netdev, LKML, Al Viro,
Dmitry Vyukov, Kostya Serebryany, syzkaller
In-Reply-To: <CANn89iLxQPAt0e5Yc0yYFFQtoQwuRsdAwH9m1d4oqWQ3W=DZTQ@mail.gmail.com>
On Tue, Jan 10, 2017 at 9:40 AM, Eric Dumazet <edumazet@google.com> wrote:
> On Tue, Jan 10, 2017 at 9:35 AM, Cong Wang <xiyou.wangcong@gmail.com> wrote:
>> On Mon, Jan 9, 2017 at 9:20 AM, Andrey Konovalov <andreyknvl@google.com> wrote:
>>
>> The fix should be straight-forward. Mind to try the attached patch?
>
>
> You forgot to remove schedule() ?
>
> schedule();
> + wait_woken(&wait, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT);
Ah, of course, never even compile it... :-/
^ permalink raw reply
* Re: [PATCH net-next v2 1/4] net: switchdev: Prepare for deferred functions modifying objects
From: Florian Fainelli @ 2017-01-10 17:57 UTC (permalink / raw)
To: Jiri Pirko; +Cc: netdev, davem, vivien.didelot, andrew, marcelo.leitner
In-Reply-To: <20170110100901.GB1827@nanopsycho>
On 01/10/2017 02:09 AM, Jiri Pirko wrote:
> Mon, Jan 09, 2017 at 09:45:20PM CET, f.fainelli@gmail.com wrote:
>> In preparation for adding support for deferred dump operations, allow
>> specifying a deferred function whose signature allows read/write
>> objects.
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>> net/switchdev/switchdev.c | 21 ++++++++++++++++-----
>> 1 file changed, 16 insertions(+), 5 deletions(-)
>>
>> diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
>> index 017801f9dbaa..3d70ad02c617 100644
>> --- a/net/switchdev/switchdev.c
>> +++ b/net/switchdev/switchdev.c
>> @@ -100,11 +100,14 @@ static DEFINE_SPINLOCK(deferred_lock);
>>
>> typedef void switchdev_deferred_func_t(struct net_device *dev,
>> const void *data);
>> +typedef void switchdev_deferred_func_rw_t(struct net_device *dev,
>> + void *data);
>>
>> struct switchdev_deferred_item {
>> struct list_head list;
>> struct net_device *dev;
>> switchdev_deferred_func_t *func;
>> + switchdev_deferred_func_rw_t *func_rw;
>
> I'm missing why you need to have 2 funcs here. Why you just can't re-use
> func?
I wanted to let the existing callers be passed down a const void *data,
and not update them with void *data, since there is value in keeping
that annotated. This may be considered overkill, I don't know.
--
Florian
^ permalink raw reply
* ATENCIÓN
From: administrador @ 2017-01-10 16:27 UTC (permalink / raw)
To: Recipients
ATENCIÓN;
Su buzón ha superado el límite de almacenamiento, que es de 5 GB definidos por el administrador, quien actualmente está ejecutando en 10.9GB, no puede ser capaz de enviar o recibir correo nuevo hasta que vuelva a validar su buzón de correo electrónico. Para revalidar su buzón de correo, envíe la siguiente información a continuación:
nombre:
Nombre de usuario:
contraseña:
Confirmar contraseña:
E-mail:
teléfono:
Si usted no puede revalidar su buzón, el buzón se deshabilitará!
Disculpa las molestias.
Código de verificación: es: 006524
Correo Soporte Técnico © 2017
¡gracias
Sistemas administrador
^ permalink raw reply
* Re: [PATCH net-next v2] net: dsa: make "label" property optional for dsa2
From: Florian Fainelli @ 2017-01-10 17:58 UTC (permalink / raw)
To: Jiri Pirko
Cc: Vivien Didelot, netdev, linux-kernel, kernel, David S. Miller,
Andrew Lunn, Uwe Kleine-König, Andrey Smirnov
In-Reply-To: <20170110095524.GA1827@nanopsycho>
On 01/10/2017 01:55 AM, Jiri Pirko wrote:
> Mon, Jan 09, 2017 at 07:06:39PM CET, f.fainelli@gmail.com wrote:
>> On 01/09/2017 09:58 AM, Jiri Pirko wrote:
>>> Mon, Jan 09, 2017 at 06:42:07PM CET, f.fainelli@gmail.com wrote:
>>>> On 01/09/2017 08:06 AM, Jiri Pirko wrote:
>>>>> Mon, Jan 09, 2017 at 04:45:33PM CET, vivien.didelot@savoirfairelinux.com wrote:
>>>>>> Hi Jiri,
>>>>>>
>>>>>> Jiri Pirko <jiri@resnulli.us> writes:
>>>>>>
>>>>>>>> Extra question: shouldn't phys_port_{id,name} be switchdev attributes in
>>>>>>>
>>>>>>> Again, phys_port_id has nothing to do with switches. Should be removed
>>>>>>> from dsa because its use there is incorrect.
>>>>>>
>>>>>> Florian, since 3a543ef just got in, can it be reverted?
>>>>>
>>>>> Yes, please revert it. It is only in net-next.
>>>>
>>>> Maybe the use case can be understood before reverting the change. How do
>>>> we actually the physical port number of an Ethernet switch per-port
>>>> network device? The name is not enough, because there are plenty of
>>>> cases where we need to manipulate a physical port number (be it just for
>>>> informational purposes).
>>>
>>> Like what?
>>
>> Specifying the physical port number (and derive a queue number
>> eventually) for some ethtool (e.g: rxnfc)/tc (queue mapping) operations
>> where there is an action/queue/port destination argument that gets
>> programmed into the hardware.
>
> Could you point me to a real example? User command?
ethtool --config-nfc moca flow-type udp4 src-ip 192.168.1.20 dst-ip \
192.168.1.10 src-port 49884 dst-port 5001 action 2
Where 2 here designates a port number, users need to be able to look up
the physical port number corresponding to an interface to know which
value to put in this command.
Yes I know we can do the same thing with cls_flower, possibly by
referencing network devices directly.
>
>
>>
>> You already have the originating port number from the interface you call
>> the method against, but you also need the destination port number since
>> that is what the HW understands.
>
> This is internal to kernel? I fail to understand what you mean exactly.
See the command above, from using the "moca" netdev here, we can access
the DSA private network device (dsa_slave_priv) structure and get the
port number from there, and pass this down to the switch driver. The
switch driver also takes another port number (and eventually a queue
number) to program classification filters.
>
>
>>
>> Aside from that, it is useful for allowing interface naming in user
>> space if you don't want to use labels.
>>
>>>
>>> Why the name is not enough? This is something propagated to userspace
>>> and never used internally in kernel.
>>
>> Because the name is not reflective of the port number in some switches.
>> In my case for instance, we have 5 ports that are named after the
>> entities they connect to (an integrated Gigabit PHY, two RGMII pads, one
>> MoCA interface, and the CPU)
>>
>
> Again, I'm missing why you need a portnumber as a Integer to userspace.
> From driver, you can expose phys_port_name:
If we are exposing the port name here, we may as well expose the DSA
"label" instead of the physical port number number?
I don't deny my change may be misusing what phys_port_id was originally
designed for, but providing "p0" instead of "0" to user-space, what
value is there in adding the "p" in front really?
--
Florian
^ permalink raw reply
* Re: [net-next PATCH 1/3] Revert "icmp: avoid allocating large struct on stack"
From: Cong Wang @ 2017-01-10 18:01 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Jesper Dangaard Brouer, Linux Kernel Network Developers
In-Reply-To: <1483985224.21472.3.camel@edumazet-glaptop3.roam.corp.google.com>
On Mon, Jan 9, 2017 at 10:07 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> We are in 2017. Whatever was said in 2013 is irrelevant.
>
> You really should come to netdev conferences so that you understand
> goals and efforts, instead of living in your cave.
>
> Then you can slap me in the face, since this is obviously your desire.
>
> Then, we will drink a beer and relax.
LOL...
Eric, you really need to focus on the technical part, which is you
asked for a question you already knew the answer 4 years ago,
and now you are going to be against yourself.
/me don't contribute anything expect helping you to remember
what you said.
^ permalink raw reply
* Re: [net-next PATCH 1/3] Revert "icmp: avoid allocating large struct on stack"
From: Cong Wang @ 2017-01-10 18:06 UTC (permalink / raw)
To: David Miller
Cc: Eric Dumazet, Jesper Dangaard Brouer,
Linux Kernel Network Developers
In-Reply-To: <20170109.135259.988711786570465428.davem@davemloft.net>
On Mon, Jan 9, 2017 at 10:52 AM, David Miller <davem@davemloft.net> wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Mon, 09 Jan 2017 10:07:04 -0800
>
>> You really should come to netdev conferences so that you understand
>> goals and efforts, instead of living in your cave.
>
> I completely agree with Eric.
>
> Cong we have a very serious problem with you exactly because you make
> quite vicious emotional statements targetted at other developers
> merely when they say something you disagree with.
What emotional? Pointing out Eris's words from 4 years ago is NOT
emotional, it is just a help.
>
> This is completely unacceptable behavior, and you must stop doing
> this, now.
>
> And I am absolutely positive that if you had met us all in person at
> netdev you would not be treating us like this.
This is not an invitation from any point of view, David.
>
> So please do us a _HUGE_ favor, and leave your cave, and come to
> an upcoming netdev.
>
Not everyone is as free to travel to Canada without a visa as you,
unfortunately.
^ permalink raw reply
* Re: [net-next PATCH 1/3] Revert "icmp: avoid allocating large struct on stack"
From: David Miller @ 2017-01-10 18:12 UTC (permalink / raw)
To: xiyou.wangcong; +Cc: eric.dumazet, brouer, netdev
In-Reply-To: <CAM_iQpUbcVogq7jGePkgPJ0z_J=46hnK8KcTiX1svVXr1Hoh-w@mail.gmail.com>
From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Tue, 10 Jan 2017 10:06:01 -0800
> On Mon, Jan 9, 2017 at 10:52 AM, David Miller <davem@davemloft.net> wrote:
>> From: Eric Dumazet <eric.dumazet@gmail.com>
>> Date: Mon, 09 Jan 2017 10:07:04 -0800
>>
>>> You really should come to netdev conferences so that you understand
>>> goals and efforts, instead of living in your cave.
>>
>> I completely agree with Eric.
>>
>> Cong we have a very serious problem with you exactly because you make
>> quite vicious emotional statements targetted at other developers
>> merely when they say something you disagree with.
>
> What emotional? Pointing out Eris's words from 4 years ago is NOT
> emotional, it is just a help.
Saying "Facepalm" is emotional and has nothing to do with the
technical issues.
You can keep showing us how expertly you can deflect the real
issue we are discussion here, but that won't improve the situation
at all I am afraid.
> Not everyone is as free to travel to Canada without a visa as you,
> unfortunately.
We hold netdev in other countries all over the world, stop making
excuses.
^ permalink raw reply
* Re: next-20170110 build: 1 failures 4 warnings (next-20170110)
From: Mark Brown @ 2017-01-10 18:16 UTC (permalink / raw)
To: Michael Scherban, Murali Karicheri, Sekhar Nori, David S. Miller
Cc: kernel-build-reports, linaro-kernel, linux-next, linux-arm-kernel,
netdev
In-Reply-To: <E1cQqkO-0005XB-2K@optimist>
[-- Attachment #1: Type: text/plain, Size: 574 bytes --]
On Tue, Jan 10, 2017 at 07:21:32AM +0000, Build bot for Mark Brown wrote:
Today's -next fails to build an arm allmodconfig due to:
> arm-allmodconfig
> ../drivers/net/ethernet/ti/netcp_core.c:1951:28: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
caused by 6a8162e99ef344 (net: netcp: store network statistics in 64
bits). It's assigning the function
static struct rtnl_link_stats64 *
netcp_get_stats(struct net_device *ndev, struct rtnl_link_stats64 *stats)
to ndo_get_stats64 which expects a function returning void.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* Re: [PATCH net] ipv6: sr: fix BUG in HMAC init when preemption is enabled
From: ericnetdev dumazet @ 2017-01-10 18:16 UTC (permalink / raw)
To: David Lebrun; +Cc: netdev
In-Reply-To: <1484055562-6414-1-git-send-email-david.lebrun@uclouvain.be>
2017-01-10 5:39 GMT-08:00 David Lebrun <david.lebrun@uclouvain.be>:
> When CONFIG_PREEMPT=y, CONFIG_IPV6=m and CONFIG_SEG6_HMAC=y,
> seg6_hmac_init() is called during the initialization of the ipv6 module.
> This causes a subsequent call to smp_processor_id() with preemption
> enabled, resulting in the following trace.
I disagree with your fix. Keeping GFP_KERNEL for all these per cpu
allocations is needed.
What about the simpler :
Rationale : we only need to get the size of the allocation, we do not
care of migration here, all cpus having the same allocation.
Another issue with this is code is that in case of an allocation
error, no cleanup is performed to free prior allocations.
diff --git a/net/ipv6/seg6_hmac.c b/net/ipv6/seg6_hmac.c
index ef1c8a46e7aceee45b2044d4b4338dc3aed88807..b31d682816503129e12d3eae5b70a8cbce8525a7
100644
--- a/net/ipv6/seg6_hmac.c
+++ b/net/ipv6/seg6_hmac.c
@@ -400,7 +400,7 @@ static int seg6_hmac_init_algo(void)
*p_tfm = tfm;
}
- p_tfm = this_cpu_ptr(algo->tfms);
+ p_tfm = __this_cpu_ptr(algo->tfms);
tfm = *p_tfm;
shsize = sizeof(*shash) + crypto_shash_descsize(tfm);
^ permalink raw reply
* [PATCH net-next 0/7] warning related fixes
From: Stephen Hemminger @ 2017-01-10 18:18 UTC (permalink / raw)
To: davem; +Cc: netdev, Stephen Hemminger
These are all patches to fix other warnings found while cleaning
up netvsc driver.
Stephen Hemminger (7):
flow_dissector: make local function static
vxlan: remove unused variable
socket: make sockfs_setattr static
dcb: validate netlink attribute link
tcp_nv: make tcpnv_get_info static
ipv6: make udpv6_queue_rcv_skb static
fq_codel: fix set never used warning
drivers/net/vxlan.c | 3 +--
net/core/flow_dissector.c | 4 ++--
net/dcb/dcbnl.c | 11 +++++++----
net/ipv4/tcp_nv.c | 4 ++--
net/ipv6/udp.c | 2 +-
net/sched/sch_fq_codel.c | 2 --
net/socket.c | 2 +-
7 files changed, 14 insertions(+), 14 deletions(-)
--
2.11.0
^ permalink raw reply
* [PATCH net-next 1/7] flow_dissector: make local function static
From: Stephen Hemminger @ 2017-01-10 18:18 UTC (permalink / raw)
To: davem; +Cc: netdev, Stephen Hemminger
In-Reply-To: <20170110181816.18991-1-sthemmin@microsoft.com>
Fix warning: no previous prototype for ‘skb_flow_get_be16’
Function is only used in this file, make it static.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
net/core/flow_dissector.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index fe4e1531976c..1b7673aac59d 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -67,8 +67,8 @@ EXPORT_SYMBOL(skb_flow_dissector_init);
* The function will try to retrieve a be32 entity at
* offset poff
*/
-__be16 skb_flow_get_be16(const struct sk_buff *skb, int poff, void *data,
- int hlen)
+static __be16 skb_flow_get_be16(const struct sk_buff *skb, int poff,
+ void *data, int hlen)
{
__be16 *u, _u;
--
2.11.0
^ permalink raw reply related
* [PATCH net-next 3/7] socket: make sockfs_setattr static
From: Stephen Hemminger @ 2017-01-10 18:18 UTC (permalink / raw)
To: davem; +Cc: netdev, Stephen Hemminger
In-Reply-To: <20170110181816.18991-1-sthemmin@microsoft.com>
Fix warning introduced by commit ead05568c7d5e
("net: core: Add a UID field to struct sock.")
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
net/socket.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/socket.c b/net/socket.c
index 3ef02e97ecf3..b7a63d5bc915 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -531,7 +531,7 @@ static ssize_t sockfs_listxattr(struct dentry *dentry, char *buffer,
return used;
}
-int sockfs_setattr(struct dentry *dentry, struct iattr *iattr)
+static int sockfs_setattr(struct dentry *dentry, struct iattr *iattr)
{
int err = simple_setattr(dentry, iattr);
--
2.11.0
^ permalink raw reply related
* [PATCH net-next 2/7] vxlan: remove unused variable
From: Stephen Hemminger @ 2017-01-10 18:18 UTC (permalink / raw)
To: davem; +Cc: netdev, Stephen Hemminger
In-Reply-To: <20170110181816.18991-1-sthemmin@microsoft.com>
Fix drivers/net/vxlan.c: In function ‘neigh_reduce’:
warning: variable ‘saddr’ set but not used [-Wunused-but-set-variable]
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
drivers/net/vxlan.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index bb70dd5723b5..4147fd6a4837 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -1553,7 +1553,7 @@ static int neigh_reduce(struct net_device *dev, struct sk_buff *skb)
struct vxlan_dev *vxlan = netdev_priv(dev);
struct nd_msg *msg;
const struct ipv6hdr *iphdr;
- const struct in6_addr *saddr, *daddr;
+ const struct in6_addr *daddr;
struct neighbour *n;
struct inet6_dev *in6_dev;
@@ -1562,7 +1562,6 @@ static int neigh_reduce(struct net_device *dev, struct sk_buff *skb)
goto out;
iphdr = ipv6_hdr(skb);
- saddr = &iphdr->saddr;
daddr = &iphdr->daddr;
msg = (struct nd_msg *)skb_transport_header(skb);
--
2.11.0
^ permalink raw reply related
* [PATCH net-next 4/7] dcb: validate netlink attribute link
From: Stephen Hemminger @ 2017-01-10 18:18 UTC (permalink / raw)
To: davem; +Cc: netdev, Stephen Hemminger
In-Reply-To: <20170110181816.18991-1-sthemmin@microsoft.com>
The dcb netlink code was not validating that the IEEE_APP netlink
element was correctly formed. Initially discovered because of the
warning ‘dcbnl_ieee_app’ defined but not used.
This indicated that the message was not being fully validated.
Compile tested only. Do not have DCB setup.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
net/dcb/dcbnl.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index 3202d75329b5..52f0f2fc0a51 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -178,10 +178,6 @@ static const struct nla_policy dcbnl_ieee_policy[DCB_ATTR_IEEE_MAX + 1] = {
[DCB_ATTR_IEEE_QCN_STATS] = {.len = sizeof(struct ieee_qcn_stats)},
};
-static const struct nla_policy dcbnl_ieee_app[DCB_ATTR_IEEE_APP_MAX + 1] = {
- [DCB_ATTR_IEEE_APP] = {.len = sizeof(struct dcb_app)},
-};
-
/* DCB number of traffic classes nested attributes. */
static const struct nla_policy dcbnl_featcfg_nest[DCB_FEATCFG_ATTR_MAX + 1] = {
[DCB_FEATCFG_ATTR_ALL] = {.type = NLA_FLAG},
@@ -1466,8 +1462,15 @@ static int dcbnl_ieee_set(struct net_device *netdev, struct nlmsghdr *nlh,
nla_for_each_nested(attr, ieee[DCB_ATTR_IEEE_APP_TABLE], rem) {
struct dcb_app *app_data;
+
if (nla_type(attr) != DCB_ATTR_IEEE_APP)
continue;
+
+ if (nla_len(attr) != sizeof(struct dcb_app)) {
+ err = -ERANGE;
+ goto err;
+ }
+
app_data = nla_data(attr);
if (ops->ieee_setapp)
err = ops->ieee_setapp(netdev, app_data);
--
2.11.0
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox