@@ -794,7 +794,8 @@ int promisc(const char *dev)
794
794
return err;
795
795
}
796
796
797
- #define ETH_JUMBO_FRAME_SIZE (9000 )
797
+ #define ETH_FRAME_BUFFER_SIZE (0x4000 )
798
+ #define CONTROL_MESSAGE_BUFFER_SIZE (0x1000 )
798
799
#define IEEE_8021Q_ETHER_TYPE (0x8100 )
799
800
#define MAC_ADDRESS_SIZE (6 )
800
801
#define VLAN_TAG_SIZE (4 )
@@ -803,7 +804,7 @@ void veth2tap_fun(std::shared_ptr<hostif_info_t> info)
803
804
{
804
805
SWSS_LOG_ENTER ();
805
806
806
- unsigned char buffer[0x4000 ];
807
+ unsigned char buffer[ETH_FRAME_BUFFER_SIZE ];
807
808
808
809
while (info->run_thread )
809
810
{
@@ -819,7 +820,7 @@ void veth2tap_fun(std::shared_ptr<hostif_info_t> info)
819
820
iov[0 ].iov_base = buffer; // buffer for message
820
821
iov[0 ].iov_len = sizeof (buffer);
821
822
822
- char control[0x1000 ]; // buffer for control messages
823
+ char control[CONTROL_MESSAGE_BUFFER_SIZE ]; // buffer for control messages
823
824
824
825
msg.msg_name = &src_addr;
825
826
msg.msg_namelen = sizeof (src_addr);
@@ -838,7 +839,7 @@ void veth2tap_fun(std::shared_ptr<hostif_info_t> info)
838
839
continue ;
839
840
}
840
841
841
- if (size < (ssize_t )sizeof (ethhdr) || size > ETH_JUMBO_FRAME_SIZE )
842
+ if (size < (ssize_t )sizeof (ethhdr))
842
843
{
843
844
SWSS_LOG_ERROR (" invalid ethernet frame length: %zu" , msg.msg_controllen );
844
845
continue ;
@@ -905,7 +906,7 @@ void tap2veth_fun(std::shared_ptr<hostif_info_t> info)
905
906
{
906
907
SWSS_LOG_ENTER ();
907
908
908
- unsigned char buffer[0x4000 ];
909
+ unsigned char buffer[ETH_FRAME_BUFFER_SIZE ];
909
910
910
911
while (info->run_thread )
911
912
{
0 commit comments