2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00
Commit Graph

50 Commits

Author SHA1 Message Date
Qian Chen
7490f281f0 lldp: Fix bugs when parsing malformed AutoAttach.
The OVS LLDP implementation includes support for AutoAttach standard, which
the 'upstream' lldpd project does not include.  As part of adding this
support, the message parsing for these TLVs did not include proper length
checks for the LLDP_TLV_AA_ELEMENT_SUBTYPE and the
LLDP_TLV_AA_ISID_VLAN_ASGNS_SUBTYPE elements.  The result is that a message
without a proper boundary will cause an overread of memory, and lead to
undefined results, including crashes or other unidentified behavior.

The fix is to introduce proper bounds checking for these elements.  Introduce
a unit test to ensure that we have some proper rejection in this code
base in the future.

Fixes: be53a5c447 ("auto-attach: Initial support for Auto-Attach standard")
Signed-off-by: Qian Chen <cq674350529@163.com>
Co-authored-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2022-12-20 17:26:25 +01:00
lic121
509c32765a lldp: Fix lldp memory leak.
lldp_create() malloc memory for lldp->lldpd->g_hardware. lldp_unref
is supposed to free the memory regardless of hw->h_flags.

Signed-off-by: lic121 <lic121@chinatelecom.cn>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Paolo Valerio <pvalerio@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2022-06-28 12:06:11 +02:00
Adrian Moreno
e9bf5bffb0 list: use short version of safe loops if possible.
Using the SHORT version of the *_SAFE loops makes the code cleaner
and less error-prone. So, use the SHORT version and remove the extra
variable when possible.

In order to be able to use both long and short versions without changing
the name of the macro for all the clients, overload the existing name
and select the appropriate version depending on the number of arguments.

Acked-by: Dumitru Ceara <dceara@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2022-03-30 16:59:02 +02:00
Dumitru Ceara
172d8bfed8 bfd: lldp: stp: Fix misaligned packet field access.
UB Sanitizer reports:
  lib/bfd.c:748:16:
        runtime error: member access within misaligned address 0x000001f0d6ea
                       for type 'struct msg', which requires 4 byte alignment
  0x000001f0d6ea: note: pointer points here
   00 20  00 00 20 40 03 18 93 f9  0a 6e 00 00 00 00 00 0f 42 40 00 0f ...
                ^
      #0 0x59008e in bfd_process_packet lib/bfd.c:748
      #1 0x52a240 in process_special ofproto/ofproto-dpif-xlate.c:3370
      #2 0x553452 in xlate_actions ofproto/ofproto-dpif-xlate.c:7766
      #3 0x4fc9e6 in upcall_xlate ofproto/ofproto-dpif-upcall.c:1237
      #4 0x4fdecc in process_upcall ofproto/ofproto-dpif-upcall.c:1456
      #5 0x4fd936 in upcall_cb ofproto/ofproto-dpif-upcall.c:1358
      [...]
  lib/stp.c:754:15:
        runtime error: member access within misaligned address 0x000002c4ea61
        for type 'const   struct stp_bpdu_header', which requires 2 byte alignment
  0x000002c4ea61: note: pointer points here
   26 42 42  03 00 00 00 00 00 80 00  aa 66 aa 66 00 01 00 00  00 00 80 ...
                ^
      #0 0x8a2bce in stp_received_bpdu lib/stp.c:754
      #1 0x51e603 in stp_process_packet ofproto/ofproto-dpif-xlate.c:1788
      #2 0x52a96d in process_special ofproto/ofproto-dpif-xlate.c:3394
      #3 0x5534df in xlate_actions ofproto/ofproto-dpif-xlate.c:7766
      #4 0x4fcb49 in upcall_xlate ofproto/ofproto-dpif-upcall.c:1237
      [...]
  lib/lldp/lldp.c:149:10:
        runtime error: load of misaligned address 0x7ffcc0ae72bd for type
                       'ovs_be16', which requires 2 byte alignment
  0x7ffcc0ae72bd: note: pointer points here
   8e e7 84 ad 04 00 05  46 61 73 74 45 74 68 65  72 6e 65 74 20 31 2f 35 ...
               ^
      #0 0x718d63 in lldp_tlv_end lib/lldp/lldp.c:149
      #1 0x7191de in lldp_send lib/lldp/lldp.c:184
      #2 0x484d6c in test_aa_send tests/test-aa.c:238
      [...]

Acked-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2022-02-14 23:35:55 +01:00
Ben Pfaff
4cb38cd222 ovs-lldp: Get rid of pointless null pointer check.
lldpd_alloc_hardware() always returns nonnull.

At the same time, there's no reason that lldpd_alloc_hardware() doesn't
take a const char *, so change that.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Ilya Maximets <i.maximets@ovn.org>
2021-04-07 09:34:24 -07:00
Aaron Conole
78e712c0b1 lldp: do not leak memory on multiple instances of TLVs
Upstream commit:
    commit a8d3c90feca548fc0656d95b5d278713db86ff61
    Date: Tue, 17 Nov 2020 09:28:17 -0500

    lldp: avoid memory leak from bad packets

    A packet that contains multiple instances of certain TLVs will cause
    lldpd to continually allocate memory and leak the old memory.  As an
    example, multiple instances of system name TLV will cause old values
    to be dropped by the decoding routine.

    Reported-at: https://github.com/openvswitch/ovs/pull/337
    Reported-by: Jonas Rudloff <jonas.t.rudloff@gmail.com>
    Signed-off-by: Aaron Conole <aconole@redhat.com>

Vulnerability: CVE-2020-27827
Signed-off-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-01-13 16:54:02 +01:00
Vincent Bernat
965f2e47e6 lldp: correctly increase discarded count
Upstream commit:
    commit 32f0deeebc9172c3f5f4a4d02aab32e6904947f6
    Date: Sat, 18 Feb 2017 20:11:47 +0100

    lldpd: correctly increase discarded count

    When a frame cannot be decoded but has been guessed, increase the
    discarded count.

    Fix https://github.com/vincentbernat/lldpd/issues/223

Fixes: be53a5c447 ("auto-attach: Initial support for Auto-Attach standard")
Co-authored-by: Fabrizio D'Angelo <fdangelo@redhat.com>
Signed-off-by: Fabrizio D'Angelo <fdangelo@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2020-11-16 17:47:11 +01:00
Vincent Bernat
b2c3c78240 lldp: increase statsTLVsUnrecognizedTotal on unknown TLV
Upstream commit:
    commit 109bcd423cd560545ec7940d73a50c5584aebb0c
    Author: Vincent Bernat <vincent@bernat.ch>
    Date: Sat, 6 Apr 2019 21:17:25 +0200

    This was done for organization TLVs, but not for other TLVs.

    Fix https://github.com/vincentbernat/lldpd/issues/323

Fixes: be53a5c447 ("auto-attach: Initial support for Auto-Attach standard")
Signed-off-by: Fabrizio D'Angelo <fdangelo@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2020-11-16 17:47:11 +01:00
Vincent Bernat
bb5a9937fa lldp: fix a buffer overflow when handling management address TLV
Upstream commit:
    commit a8d8006c06d9ac16ebcf33295cbd625c0847ca9b
    Author: Vincent Bernat <vincent@bernat.im>
    Date: Sun, 4 Oct 2015 01:50:38 +0200

    lldp: fix a buffer overflow when handling management address TLV

    When a remote device was advertising a too large management address
    while still respecting TLV boundaries, lldpd would crash due to a buffer
    overflow. However, the buffer being a static one, this buffer overflow
    is not exploitable if hardening was not disabled. This bug exists since
    version 0.5.6.

Fixes: be53a5c447 ("auto-attach: Initial support for Auto-Attach standard")
Reported-by: Jonas Rudloff <jonas.t.rudloff@gmail.com>
Reported-at: https://github.com/openvswitch/ovs/pull/335
Co-authored-by: Fabrizio D'Angelo <fdangelo@redhat.com>
Signed-off-by: Fabrizio D'Angelo <fdangelo@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2020-11-16 17:47:11 +01:00
Jonas Johansson
1c8e46d105 lldp: Fix size of PEEK_DISCARD_UINT32()
Upstream commit:
    commit a8d8006c06d9ac16ebcf33295cbd625c0847ca9b
    Author: Jonas Johansson <jonasj76@gmail.com>
    Date:   Thu, 21 Apr 2016 11:50:06 +0200

    Fix size of PEEK_DISCARD_UINT32()

    Signed-off-by: Jonas Johansson <jonasj76@gmail.com>

Fixes: be53a5c447 ("auto-attach: Initial support for Auto-Attach standard")
Reported-by: Jonas Rudloff <jonas.t.rudloff@gmail.com>
Reported-at: https://github.com/openvswitch/ovs/pull/336
Signed-off-by: Fabrizio D'Angelo <fdangelo@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2020-11-16 17:47:11 +01:00
Vincent Bernat
955b120df8 lldp: validate a bit more received LLDP frames
Upstream commit:
    commit 3aeae72b97716fddac290634fad02b952d981f17
    Author: Vincent Bernat <vincent@bernat.ch>
    Date:   Tue, 1 Oct 2019 21:42:42 +0200

    lldp: validate a bit more received LLDP frames

    Notably, we ensure the order and unicity of Chassis ID, Port ID and
    TTL TLV. For Chassis ID and Port ID, we also ensure the maximum size
    does not exceed 256.

    Fix https://github.com/vincentbernat/lldpd/issues/351

Fixes: be53a5c447 ("auto-attach: Initial support for Auto-Attach standard")
Signed-off-by: Aaron Conole <aconole@redhat.com>
Co-authored-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2020-11-16 17:47:11 +01:00
Ben Pfaff
91fc374a9c Eliminate use of term "slave" in bond, LACP, and bundle contexts.
The new term is "member".

Most of these changes should not change user-visible behavior.  One
place where they do is in "ovs-ofctl dump-flows", which will now output
"members:..." inside "bundle" actions instead of "slaves:...".  I don't
expect this to cause real problems in most systems.  The old syntax
is still supported on input for backward compatibility.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
2020-10-21 11:28:24 -07:00
Ben Pfaff
f5129153e3 treewide: Remove pointless "return;" at ends of functions.
Found with:
    git ls-files | xargs pcregrep -n -M 'return;\n*}'

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Darrell Ball <dlu998@gmail.com>
Tested-by: Darrell Ball <dlu998@gmail.com>
2018-07-09 20:53:06 -07:00
Aaron Conole
3df52f3d14 lldp: fix string warnings
lib/lldp/lldpd.c: In function :
lib/lldp/lldpd.c:520:17: warning:  output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
                strncat(buffer, cfg->g_protocols[i].name,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                strlen(cfg->g_protocols[i].name));
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lib/lldp/lldpd.c: In function :
lib/lldp/lldpd.c:519:17: warning:  specified bound 2 equals source length [-Wstringop-overflow=]
                strncat(buffer, ", ", 2);
                ^~~~~~~~~~~~~~~~~~~~~~~~

Closer inspection shows that buffer is only used to output protocol names
when debug logging is enabled, so restructure the code a bit as well.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-06-14 13:22:24 -07:00
Ben Pfaff
b2befd5bb2 sparse: Add guards to prevent FreeBSD-incompatible #include order.
FreeBSD insists that <sys/types.h> be included before <netinet/in.h> and
that <netinet/in.h> be included before <arpa/inet.h>.  This adds guards to
the "sparse" headers to yield a warning if this order is violated.  This
commit also adjusts the order of many #includes to suit this requirement.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
2017-12-22 12:58:02 -08:00
Ben Pfaff
134fefa4de types: New macros ETH_ADDR_C and ETH_ADDR64_C.
These macros expand to constants of type struct eth_addr and struct
eth_addr64, respectively, and make it more convenient to initialize or
assign to an Ethernet address object.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
2017-11-29 13:27:16 -08:00
Ben Pfaff
71f21279f6 Eliminate most shadowing for local variable names.
Shadowing is when a variable with a given name in an inner scope hides a
different variable with the same name in a surrounding scope.  This is
generally undesirable because it can confuse programmers.  This commit
eliminates most of it.

Found with -Wshadow=local in GCC 7.  The repo is not really ready to enable
this option by default because of a few cases that are harder to fix, and
harmless, such as nested use of CMAP_FOR_EACH.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
2017-08-02 15:03:35 -07:00
Ben Warren
417e7e66e1 list: Rename all functions in list.h with ovs_ prefix.
This attempts to prevent namespace collisions with other list libraries

Signed-off-by: Ben Warren <ben@skyportsystems.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2016-03-30 13:04:32 -07:00
Ben Warren
b19bab5b20 list: Remove lib/list.h completely.
All code is now in include/openvswitch/list.h.

Signed-off-by: Ben Warren <ben@skyportsystems.com>
Acked-by: Ryan Moats <rmoats@us.ibm.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2016-03-30 13:01:21 -07:00
Jarno Rajahalme
74ff3298c8 userspace: Define and use struct eth_addr.
Define struct eth_addr and use it instead of a uint8_t array for all
ethernet addresses in OVS userspace.  The struct is always the right
size, and it can be assigned without an explicit memcpy, which makes
code more readable.

"struct eth_addr" is a good type name for this as many utility
functions are already named accordingly.

struct eth_addr can be accessed as bytes as well as ovs_be16's, which
makes the struct 16-bit aligned.  All use seems to be 16-bit aligned,
so some algorithms on the ethernet addresses can be made a bit more
efficient making use of this fact.

As the struct fits into a register (in 64-bit systems) we pass it by
value when possible.

This patch also changes the few uses of Linux specific ETH_ALEN to
OVS's own ETH_ADDR_LEN, and removes the OFP_ETH_ALEN, as it is no
longer needed.

This work stemmed from a desire to make all struct flow members
assignable for unrelated exploration purposes.  However, I think this
might be a nice code readability improvement by itself.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
2015-08-28 14:55:11 -07:00
Dennis Flynn
86b68e90b3 auto-attach: Cleanup i-sid/vlan mappings associated with lldp-enabled port.
This commit fixes a bug where the i-sid/vlan mapping structures associated with
an lldp-enabled port were not being freed during general port cleanup.

Signed-off-by: Dennis Flynn <drflynn@avaya.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-06-17 07:25:58 -07:00
Jarno Rajahalme
5f03c98321 lib/list: Add LIST_FOR_EACH_POP.
Makes popping each member of the list a bit easier.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-04-06 14:02:28 -07:00
Dennis Flynn
14691214d1 auto-attach: Support latest version of auto-attach LLDP TLVs
The following enhancements to the auto-attach feature are provided

- Support recent modifications to the AA element discovery TLV
- Support recent Avaya Organizationally Unique ID (OUI) change.
  (This will change to IEEE assigned OUI once AA standard has been ratified)
- Remove some Avaya specific #defines

The primary purpose of this commit is to catch up with the latest changes made
to the auto attach TLVs as the Auto Attach feature progresses through the
802.1Q IEEE standards committee. Most notably this includes some minor rework
of the AA element discovery TLV and a recent change to the Avaya OUI value.

Signed-off-by: Dennis Flynn <drflynn@avaya.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-23 13:28:53 -07:00
Pravin B Shelar
09c28fa321 lldp: Fix DPDK build.
Fixes following dp-packet access. Removes netinet/if_ether.h
include due to duplicate definition of ether_addr.

------
In file included from /usr/include/netinet/if_ether.h:60:0,
                 from lib/lldp/lldpd.h:23,
                 from lib/ovs-lldp.h:26,
                 from lib/ovs-lldp.c:30:
/usr/include/net/ethernet.h: At top level:
/usr/include/net/ethernet.h:32:8: error: redefinition of 'struct
ether_addr'
 struct ether_addr
        ^
In file included from
../dpdk/dpdk/x86_64-native-linuxapp-gcc/include/rte_ethdev.h:179:0,
                 from lib/netdev-dpdk.h:18,
                 from lib/dp-packet.h:25,
                 from lib/ovs-lldp.h:23,
                 from lib/ovs-lldp.c:30:
../dpdk/dpdk/x86_64-native-linuxapp-gcc/include/rte_ether.h:83:8: note:
originally defined here
 struct ether_addr {
        ^
lib/ovs-lldp.c: In function 'lldp_process_packet':
lib/ovs-lldp.c:676:30: error: 'const struct dp_packet' has no member
named 'data_'
                    (char *) p->data_, p->size_);
                              ^
lib/ovs-lldp.c:676:40: error: 'const struct dp_packet' has no member
named 'size_'
                    (char *) p->data_, p->size_);
------

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-03-04 09:59:44 -08:00
Ben Pfaff
ac211bdd76 lldp: Fully parenthesize some macro definitions.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:22:34 -08:00
Ben Pfaff
88f07b5892 lldp: Remove unused definitions from headers.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:22:34 -08:00
Ben Pfaff
2cbb2d9011 lldpd: Fix use of list of struct lldpd_hardware.
A list of some type should have type "struct ovs_list", not some other
type that encapsulates it.

This ovs_list is a bit puzzling in itself, because it appears to always
have exactly one element.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:22:34 -08:00
Ben Pfaff
e87a8e67fa lldpd: Fix use of list of struct lldpd_chassis.
A list of some type should have type "struct ovs_list", not some other
type that encapsulates it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:22:33 -08:00
Ben Pfaff
3622191996 lldpd-structs: Declare Boolean member as one bit, not two.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:22:33 -08:00
Ben Pfaff
806cc1ebe5 lldpd: Remove unused members from struct lldpd.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:22:33 -08:00
Ben Pfaff
6db3f8b065 lldp: Use ETH_ADDR_FMT.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:22:32 -08:00
Ben Pfaff
f94d6e7804 lldp: Remove excessive parentheses.
The OVS style is to usually avoid parentheses in cases like these where
they just make expressions harder to read.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:22:32 -08:00
Ben Pfaff
a268e134b6 lldpd: Fix return value convention for "send" function.
errno values are positive values, so it's not reasonable to use E2BIG as
an error return with positive values also indicating packet lengths.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:22:32 -08:00
Ben Pfaff
809fd54df3 lldpd: Remove unused ALIGNED_CAST macro.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:22:32 -08:00
Ben Pfaff
937f71bf6c lldpd: Use CONTAINER_OF instead of cast, for safety.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:22:31 -08:00
Ben Pfaff
24738b7e99 lldpd: Remove obsolete comment.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:22:30 -08:00
Ben Pfaff
f856318e14 lldp: Miscellaneous coding style fixes.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:22:13 -08:00
Ben Pfaff
1acaf4ac8f lldpd-structs: Fix type of c_id member.
This member is typically an Ethernet address so the appropriate type is
uint8_t, not char.  This eliminates a couple of casts.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:22:12 -08:00
Ben Pfaff
135706b393 lldp-structs: Fix use of list of struct lldpd_port.
A list of some type should have type "struct ovs_list", not some other
type that encapsulates it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:22:09 -08:00
Ben Pfaff
32590179d4 lldp-structs: Fix use of list of struct lldpd_mgmt.
A list of some type should have type "struct ovs_list", not some other
type that encapsulates it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:19:29 -08:00
Ben Pfaff
854560f8dc lldp-structs: Fix use of list of lldpd_aa_isid_vlan_maps_tlv.
A list of some type should have type "struct ovs_list", not some other
type that encapsulates it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:19:29 -08:00
Ben Pfaff
02c842eb74 lldp: Change representation of ISID to uint32_t.
It's a lot more straightforward to deal with integer values as integers
instead of arrays of bytes.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:19:29 -08:00
Ben Pfaff
e8fa10d754 lldpd-structs: Fix spelling error in message.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:19:28 -08:00
Ben Pfaff
8a42c2d675 lldp: Declare "bool" variables as type "bool".
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:19:28 -08:00
Ben Pfaff
02d593b194 lldp: Use "bool" for boolean variables.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:19:28 -08:00
Ben Pfaff
d9f3b69e7c lldp: Use OVS time functions.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:19:27 -08:00
Ben Pfaff
cc84196628 lldp: Use x*alloc() functions instead of writing them out in-place.
Also use flexible array member instead of array of length 1 in
struct lldpd_frame.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:19:27 -08:00
Ben Pfaff
22736f59c1 lldp: Get rid of POKE macros in favor of inline functions.
The POKE macros previously used here don't match the style usually used in
OVS and they require the user to know exactly how many bytes to reserve.
This commit replaces them by easier-to-use inline functions that take
advantage of the ofpbuf interface.

Also removes a few PEEK macros that weren't used anywhere.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:19:27 -08:00
Dennis Flynn
0477baa93b auto-attach: Add auto-attach support to ofproto layer
Signed-off-by: Ludovic Beliveau <ludovic.beliveau@windriver.com>
Signed-off-by: Dennis Flynn <drflynn@avaya.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:19:26 -08:00
Dennis Flynn
be53a5c447 auto-attach: Initial support for Auto-Attach standard
This commit provides the initial delivery of support for the Auto-Attach
standard to Open vSwitch. This standard describes a compact method of using
IEEE 802.1AB Link Layer Discovery Protocol (LLDP) with a IEEE 802.1aq Shortest
Path Bridging (SPB) network to automatically attach network devices not
supporting IEEE 802.1ah to individual services in a SPB network. Specifically
this commit adds base LLDP support to OVS along with the LLDP extension
required to support Auto-Attach.

The base LLDP code within this commit is adapted from the open source LLDPD
project headed by Vincent Bernat. This base code is augmented with OVS specific
logic which integrates LLDP into OVS and which extends LLDP to support
Auto-Attach. The required build system changes are provided to include this new
Auto-Attach feature.

This is the first of a series of commits. Subsequent commits will be provided
to complete the task of adding Auto-Attach to OVS.

Signed-off-by: Ludovic Beliveau <ludovic.beliveau@windriver.com>
Signed-off-by: Dennis Flynn <drflynn@avaya.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:19:26 -08:00