mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-05 22:29:49 +00:00
ip4_frag: Use LWIP_MIN instead of open-coded
Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
parent
67895e7bdd
commit
20fde0be6c
@ -714,7 +714,7 @@ ip4_frag(struct pbuf *p, struct netif *netif, const ip4_addr_t *dest)
|
||||
|
||||
while (left) {
|
||||
/* Fill this fragment */
|
||||
fragsize = (left < nfb * 8) ? left : nfb * 8;
|
||||
fragsize = LWIP_MIN(left, nfb * 8);
|
||||
|
||||
#if LWIP_NETIF_TX_SINGLE_PBUF
|
||||
rambuf = pbuf_alloc(PBUF_IP, fragsize, PBUF_RAM);
|
||||
@ -751,7 +751,7 @@ ip4_frag(struct pbuf *p, struct netif *netif, const ip4_addr_t *dest)
|
||||
while (left_to_copy) {
|
||||
struct pbuf_custom_ref *pcr;
|
||||
u16_t plen = p->len - poff;
|
||||
newpbuflen = (left_to_copy < plen) ? left_to_copy : plen;
|
||||
newpbuflen = LWIP_MIN(left_to_copy, plen);
|
||||
/* Is this pbuf already empty? */
|
||||
if (!newpbuflen) {
|
||||
poff = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user