aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/send.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/send.c')
-rw-r--r--src/send.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/send.c b/src/send.c
index 85b83fa..db5efd2 100644
--- a/src/send.c
+++ b/src/send.c
@@ -149,7 +149,8 @@ static unsigned int calculate_skb_padding(struct sk_buff *skb)
* wouldn't want the final subtraction to overflow in the case of the
* padded_size being clamped.
*/
- unsigned int last_unit = skb->len % PACKET_CB(skb)->mtu;
+ unsigned int last_unit = PACKET_CB(skb)->mtu ?
+ skb->len % PACKET_CB(skb)->mtu : skb->len;
unsigned int padded_size = ALIGN(last_unit, MESSAGE_PADDING_MULTIPLE);
if (padded_size > PACKET_CB(skb)->mtu)