History

packet: Fix undefined behavior in bit shift

Shifting signed 32-bit value by 31 bits is undefined. Changing most significant bit to unsigned. Changes included in v2: - use subsystem specific subject lines - CC required mailing lists

Jiunn Chang committed 7 years ago

Commit 79293f41 parent b60a7731 file · +1 −1Browse files

Showing the changes to include/uapi/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/if_packet.h+1−1
@@ -123,7 +123,7 @@ struct tpacket_auxdata { · 122 unmodified lines
123123 /* Rx and Tx ring - header status */
124124 #define TP_STATUS_TS_SOFTWARE (1 << 29)
125125 #define TP_STATUS_TS_SYS_HARDWARE (1 << 30) /* deprecated, never set */
126−#define TP_STATUS_TS_RAW_HARDWARE (1 << 31)
126+#define TP_STATUS_TS_RAW_HARDWARE (1U << 31)
127127
128128 /* Rx ring - feature request bits */
129129 #define TP_FT_REQ_FILL_RXHASH 0x1

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t