On 06/10/14 at 04:47pm, Jesse Gross wrote: > In some cases, the names of tunnel protocols are longer than the > maximum allowed after concatenating port numbers. This truncates > names to the correct size rather than assert-failing on the assumption > that collisions between names of protocols are rather rate. > > Signed-off-by: Jesse Gross <je...@nicira.com> > --- > lib/netdev-vport.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c > index c214bf7..4dca091 100644 > --- a/lib/netdev-vport.c > +++ b/lib/netdev-vport.c > @@ -151,14 +151,12 @@ netdev_vport_get_dpif_port(const struct netdev *netdev, > const char *type = netdev_get_type(netdev); > > /* > - * Note: IFNAMSIZ is 16 bytes long. The maximum length of a VXLAN > - * or LISP port name below is 15 or 14 bytes respectively. Still, > - * assert here on the size of strlen(type) in case that changes > - * in the future. > + * Note: IFNAMSIZ is 16 bytes long. If the length of the type plus > + * the rest of the name is greater than this, trucate the type to '''''''
> + * fit. The probability of collisions seems quite low. > */ > BUILD_ASSERT(NETDEV_VPORT_NAME_BUFSIZE >= IFNAMSIZ); _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev