lib: add warning when prefix doesn't match tree

Sometimes one lacks sleep and accidentally applies a patch
to the wrong tree. In case such hypothetical person names
their directories by the tree name (git's default when cloning)
we can try to help out and match the tree name to current dir.

Print a red warning when current directory is a well known tree
name, and the patch has been tagged with a well known tree name
but they don't match. Recognize net and bpf with an optional
"-next" suffix.

Signed-off-by: Jakub Kicinski <>
Signed-off-by: Daniel Borkmann <>
1 file changed